Copied files over from SVN repositories

This commit is contained in:
2016-11-14 15:38:40 +01:00
commit 7bca3829fa
140 changed files with 83112 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
########################################################
# Makefile for drscl executable under linux
#
# S. Ritt, Nov. 2016
########################################################
# determine OS
OSTYPE = $(shell uname)
FLAGS = -g -O3 -Wall -Wuninitialized -Wno-unused-result -DOS_LINUX
FLAGS += -I../include -I/usr/local/include
LIBS = -lpthread -lutil -lusb-1.0
OBJECTS = DRS.o averager.o musbstd.o mxml.o strlcpy.o
EXECS = drscl drs_exam drs_exam_multi
ifeq ($(OSTYPE),Darwin)
FLAGS += -DHAVE_USB -DHAVE_LIBUSB10
LIBS += -framework IOKit -framework CoreFoundation -lobjc
else
FLAGS += -DHAVE_USB -DHAVE_LIBUSB10
endif
all: $(EXECS)
drscl: $(OBJECTS) drscl.o
$(CXX) $(FLAGS) $(OBJECTS) drscl.o -o drscl $(LIBS)
drs_exam: $(OBJECTS) drs_exam.o
$(CXX) $(FLAGS) $(OBJECTS) drs_exam.o -o drs_exam $(LIBS)
drs_exam_multi: $(OBJECTS) drs_exam_multi.o
$(CXX) $(FLAGS) $(OBJECTS) drs_exam_multi.o -o drs_exam_multi $(LIBS)
drscl.o: drscl.cpp ../include/DRS.h
$(CC) $(FLAGS) -c $<
drs_exam.o: drs_exam.cpp ../include/DRS.h
$(CC) $(FLAGS) -c $<
drs_exam_multi.o: drs_exam_multi.cpp ../include/DRS.h
$(CC) $(FLAGS) -c $<
musbstd.o: ../src//musbstd.c ../include/musbstd.h
$(CC) $(FLAGS) -c $<
DRS.o: ../src/DRS.cpp ../include/DRS.h
$(CXX) $(FLAGS) -c $<
mxml.o: ../src/mxml.c ../include/mxml.h
$(CC) $(FLAGS) -c $<
strlcpy.o: ../src/strlcpy.c ../include/strlcpy.h
$(CC) $(FLAGS) -c $<
averager.o: ../src/averager.cpp ../include/averager.h
$(CC) $(FLAGS) -c $<
clean:
rm -f *.o $(EXECS)
+166
View File
@@ -0,0 +1,166 @@
/********************************************************************\
Name: drs_exam.cpp
Created by: Stefan Ritt
Contents: Simple example application to read out a DRS4
evaluation board
$Id: drs_exam.cpp 21308 2014-04-11 14:50:16Z ritt $
\********************************************************************/
#include <math.h>
#ifdef _MSC_VER
#include <windows.h>
#elif defined(OS_LINUX)
#define O_BINARY 0
#include <unistd.h>
#include <ctype.h>
#include <sys/ioctl.h>
#include <errno.h>
#define DIR_SEPARATOR '/'
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "strlcpy.h"
#include "DRS.h"
/*------------------------------------------------------------------*/
int main()
{
int i, j, nBoards;
DRS *drs;
DRSBoard *b;
float time_array[8][1024];
float wave_array[8][1024];
FILE *f;
/* do initial scan */
drs = new DRS();
/* show any found board(s) */
for (i=0 ; i<drs->GetNumberOfBoards() ; i++) {
b = drs->GetBoard(i);
printf("Found DRS4 evaluation board, serial #%d, firmware revision %d\n",
b->GetBoardSerialNumber(), b->GetFirmwareVersion());
}
/* exit if no board found */
nBoards = drs->GetNumberOfBoards();
if (nBoards == 0) {
printf("No DRS4 evaluation board found\n");
return 0;
}
/* continue working with first board only */
b = drs->GetBoard(0);
/* initialize board */
b->Init();
/* set sampling frequency */
b->SetFrequency(5, true);
/* enable transparent mode needed for analog trigger */
b->SetTranspMode(1);
/* set input range to -0.5V ... +0.5V */
b->SetInputRange(0);
/* use following line to set range to 0..1V */
//b->SetInputRange(0.5);
/* use following line to turn on the internal 100 MHz clock connected to all channels */
b->EnableTcal(1);
/* use following lines to enable hardware trigger on CH1 at 50 mV positive edge */
if (b->GetBoardType() >= 8) { // Evaluaiton Board V4&5
b->EnableTrigger(1, 0); // enable hardware trigger
b->SetTriggerSource(1<<0); // set CH1 as source
} else if (b->GetBoardType() == 7) { // Evaluation Board V3
b->EnableTrigger(0, 1); // lemo off, analog trigger on
b->SetTriggerSource(0); // use CH1 as source
}
b->SetTriggerLevel(0.05); // 0.05 V
b->SetTriggerPolarity(false); // positive edge
/* use following lines to set individual trigger elvels */
//b->SetIndividualTriggerLevel(1, 0.1);
//b->SetIndividualTriggerLevel(2, 0.2);
//b->SetIndividualTriggerLevel(3, 0.3);
//b->SetIndividualTriggerLevel(4, 0.4);
//b->SetTriggerSource(15);
b->SetTriggerDelayNs(0); // zero ns trigger delay
/* use following lines to enable the external trigger */
//if (b->GetBoardType() == 8) { // Evaluaiton Board V4
// b->EnableTrigger(1, 0); // enable hardware trigger
// b->SetTriggerSource(1<<4); // set external trigger as source
//} else { // Evaluation Board V3
// b->EnableTrigger(1, 0); // lemo on, analog trigger off
// }
/* open file to save waveforms */
f = fopen("data.txt", "w");
if (f == NULL) {
perror("ERROR: Cannot open file \"data.txt\"");
return 1;
}
/* repeat ten times */
for (j=0 ; j<10 ; j++) {
/* start board (activate domino wave) */
b->StartDomino();
/* wait for trigger */
printf("Waiting for trigger...");
fflush(stdout);
while (b->IsBusy());
/* read all waveforms */
b->TransferWaves(0, 8);
/* read time (X) array of first channel in ns */
b->GetTime(0, 0, b->GetTriggerCell(0), time_array[0]);
/* decode waveform (Y) array of first channel in mV */
b->GetWave(0, 0, wave_array[0]);
/* read time (X) array of second channel in ns
Note: On the evaluation board input #1 is connected to channel 0 and 1 of
the DRS chip, input #2 is connected to channel 2 and 3 and so on. So to
get the input #2 we have to read DRS channel #2, not #1. */
b->GetTime(0, 2, b->GetTriggerCell(0), time_array[1]);
/* decode waveform (Y) array of second channel in mV */
b->GetWave(0, 2, wave_array[1]);
/* Save waveform: X=time_array[i], Yn=wave_array[n][i] */
fprintf(f, "Event #%d ----------------------\n t1[ns] u1[mV] t2[ns] u2[mV]\n", j);
for (i=0 ; i<1024 ; i++)
fprintf(f, "%7.3f %7.1f %7.3f %7.1f\n", time_array[0][i], wave_array[0][i], time_array[1][i], wave_array[1][i]);
/* print some progress indication */
printf("\rEvent #%d read successfully\n", j);
}
fclose(f);
/* delete DRS object -> close USB connection */
delete drs;
}
+20
View File
@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drs_exam", "drs_exam.vcxproj", "{0A260864-8525-423F-984D-34C5BE6EDE0A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Debug|Win32.ActiveCfg = Debug|Win32
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Debug|Win32.Build.0 = Debug|Win32
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Release|Win32.ActiveCfg = Release|Win32
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+249
View File
@@ -0,0 +1,249 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="drs_exam"
ProjectGUID="{0A260864-8525-423F-984D-34C5BE6EDE0A}"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/drs_exam.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\meg\online\drivers\drs\libusb\include;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_USB;HAVE_LIBUSB;CF_VIA_USBx;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/drs_exam.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="2055"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Release/drs_exam.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/drs_exam.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/drs_exam.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\meg\online\drivers\drs\libusb\include;c:\midas\mscb\"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_USB;HAVE_LIBUSB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/drs_exam.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="2055"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib"
OutputFile=".\Debug/drs_exam.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/drs_ecam.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\DRS.cpp"
>
</File>
<File
RelativePath=".\drs_exam.cpp"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\drivers\usb\musbstd.c"
>
</File>
<File
RelativePath="..\..\..\..\..\mxml\mxml.c"
>
</File>
<File
RelativePath="..\..\..\..\..\mxml\strlcpy.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\DRS.h"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\include\musbstd.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath="..\libusb\lib\libusb.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+145
View File
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0A260864-8525-423F-984D-34C5BE6EDE0A}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/drs_exam.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\meg\online\drivers\drs\libusb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;HAVE_USB;HAVE_LIBUSB;CF_VIA_USBx;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Release/drs_exam.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0807</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/drs_exam.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/drs_exam.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/drs_exam.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\meg\online\drivers\drs\libusb\include;c:\midas\mscb\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;HAVE_USB;HAVE_LIBUSB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Debug/drs_exam.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0807</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>wsock32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\Debug/drs_exam.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/drs_ecam.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\averager.cpp" />
<ClCompile Include="..\DRS.cpp" />
<ClCompile Include="drs_exam.cpp" />
<ClCompile Include="..\..\..\..\..\midas\drivers\usb\musbstd.c" />
<ClCompile Include="..\..\..\..\..\mxml\mxml.c" />
<ClCompile Include="..\..\..\..\..\mxml\strlcpy.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\averager.h" />
<ClInclude Include="..\DRS.h" />
<ClInclude Include="..\..\..\..\..\midas\include\musbstd.h" />
</ItemGroup>
<ItemGroup>
<Library Include="..\libusb\lib\libusb.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{cba60e1f-b52a-4c57-b908-5ef691f51a23}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{50c8e0da-ffd8-40e8-80c9-0c3ba2cf6607}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{661290e6-d43c-45a6-bb95-c99296a89d32}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\DRS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="drs_exam.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\midas\drivers\usb\musbstd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\mxml\mxml.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\mxml\strlcpy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\averager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\DRS.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\midas\include\musbstd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\averager.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Library Include="..\libusb\lib\libusb.lib">
<Filter>Resource Files</Filter>
</Library>
</ItemGroup>
</Project>
@@ -0,0 +1,301 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
D563FEB61863514900F76DF2 /* averager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D563FEB51863514900F76DF2 /* averager.cpp */; };
D5F6AF8814274CF7003299EE /* DRS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8714274CF7003299EE /* DRS.cpp */; };
D5F6AF8A14274D0F003299EE /* drs_exam.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8914274D0F003299EE /* drs_exam.cpp */; };
D5F6AF8D14274D1F003299EE /* mxml.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8B14274D1F003299EE /* mxml.c */; };
D5F6AF8E14274D1F003299EE /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8C14274D1F003299EE /* strlcpy.c */; };
D5F6AF9014274D2E003299EE /* musbstd.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8F14274D2E003299EE /* musbstd.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
D5446429141E1BB40027AF52 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
D544642B141E1BB40027AF52 /* drs_exam */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = drs_exam; sourceTree = BUILT_PRODUCTS_DIR; };
D563FEB51863514900F76DF2 /* averager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = averager.cpp; path = ../averager.cpp; sourceTree = "<group>"; };
D563FEB71863515400F76DF2 /* averager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = averager.h; path = ../averager.h; sourceTree = "<group>"; };
D5F6AF8514274CE2003299EE /* DRS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DRS.h; path = ../DRS.h; sourceTree = "<group>"; };
D5F6AF8714274CF7003299EE /* DRS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DRS.cpp; path = ../DRS.cpp; sourceTree = "<group>"; };
D5F6AF8914274D0F003299EE /* drs_exam.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = drs_exam.cpp; sourceTree = "<group>"; };
D5F6AF8B14274D1F003299EE /* mxml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mxml.c; path = ../../../../../mxml/mxml.c; sourceTree = "<group>"; };
D5F6AF8C14274D1F003299EE /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = ../../../../../mxml/strlcpy.c; sourceTree = "<group>"; };
D5F6AF8F14274D2E003299EE /* musbstd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = musbstd.c; path = ../../../../../midas/drivers/usb/musbstd.c; sourceTree = "<group>"; };
D5F6AF9114274D4C003299EE /* mxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mxml.h; path = ../../../../../mxml/mxml.h; sourceTree = "<group>"; };
D5F6AF9214274D4C003299EE /* strlcpy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strlcpy.h; path = ../../../../../mxml/strlcpy.h; sourceTree = "<group>"; };
D5F6AF9314274D61003299EE /* musbstd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = musbstd.h; path = ../../../../../midas/include/musbstd.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D5446428141E1BB40027AF52 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
D5446420141E1BB40027AF52 = {
isa = PBXGroup;
children = (
D5F6AF8414274CCC003299EE /* Header Files */,
D5F6AF8614274CE8003299EE /* Source Files */,
D544642C141E1BB40027AF52 /* Products */,
);
sourceTree = "<group>";
};
D544642C141E1BB40027AF52 /* Products */ = {
isa = PBXGroup;
children = (
D544642B141E1BB40027AF52 /* drs_exam */,
);
name = Products;
sourceTree = "<group>";
};
D5F6AF8414274CCC003299EE /* Header Files */ = {
isa = PBXGroup;
children = (
D563FEB71863515400F76DF2 /* averager.h */,
D5F6AF9314274D61003299EE /* musbstd.h */,
D5F6AF9114274D4C003299EE /* mxml.h */,
D5F6AF9214274D4C003299EE /* strlcpy.h */,
D5F6AF8514274CE2003299EE /* DRS.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
D5F6AF8614274CE8003299EE /* Source Files */ = {
isa = PBXGroup;
children = (
D563FEB51863514900F76DF2 /* averager.cpp */,
D5F6AF8F14274D2E003299EE /* musbstd.c */,
D5F6AF8B14274D1F003299EE /* mxml.c */,
D5F6AF8C14274D1F003299EE /* strlcpy.c */,
D5F6AF8914274D0F003299EE /* drs_exam.cpp */,
D5F6AF8714274CF7003299EE /* DRS.cpp */,
);
name = "Source Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D544642A141E1BB40027AF52 /* drs_exam */ = {
isa = PBXNativeTarget;
buildConfigurationList = D5446435141E1BB40027AF52 /* Build configuration list for PBXNativeTarget "drs_exam" */;
buildPhases = (
D5446427141E1BB40027AF52 /* Sources */,
D5446428141E1BB40027AF52 /* Frameworks */,
D5446429141E1BB40027AF52 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = drs_exam;
productName = drs_exam;
productReference = D544642B141E1BB40027AF52 /* drs_exam */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D5446422141E1BB40027AF52 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = PSI;
};
buildConfigurationList = D5446425141E1BB40027AF52 /* Build configuration list for PBXProject "drs_exam" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = D5446420141E1BB40027AF52;
productRefGroup = D544642C141E1BB40027AF52 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D544642A141E1BB40027AF52 /* drs_exam */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
D5446427141E1BB40027AF52 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5F6AF8814274CF7003299EE /* DRS.cpp in Sources */,
D5F6AF8A14274D0F003299EE /* drs_exam.cpp in Sources */,
D563FEB61863514900F76DF2 /* averager.cpp in Sources */,
D5F6AF8D14274D1F003299EE /* mxml.c in Sources */,
D5F6AF8E14274D1F003299EE /* strlcpy.c in Sources */,
D5F6AF9014274D2E003299EE /* musbstd.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
D5446433141E1BB40027AF52 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
D5446434141E1BB40027AF52 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx;
};
name = Release;
};
D5446436141E1BB40027AF52 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
OS_LINUX,
HAVE_USB,
HAVE_LIBUSB10,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/mxml,
/midas/include,
../,
/usr/local/include,
"/usr/local/include/libusb-1.0",
);
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"-lusb-1.0",
"-framework",
IOKit,
"-framework",
Carbon,
);
PRELINK_LIBS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
D5446437141E1BB40027AF52 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/mxml,
/midas/include,
../,
/usr/local/include,
"/usr/local/include/libusb-1.0",
);
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"-lusb-1.0",
"-framework",
IOKit,
"-framework",
Carbon,
);
PRELINK_LIBS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D5446425141E1BB40027AF52 /* Build configuration list for PBXProject "drs_exam" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D5446433141E1BB40027AF52 /* Debug */,
D5446434141E1BB40027AF52 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D5446435141E1BB40027AF52 /* Build configuration list for PBXNativeTarget "drs_exam" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D5446436141E1BB40027AF52 /* Debug */,
D5446437141E1BB40027AF52 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D5446422141E1BB40027AF52 /* Project object */;
}
+178
View File
@@ -0,0 +1,178 @@
/********************************************************************\
Name: drs_exam_multi.cpp
Created by: Stefan Ritt
Contents: Simple example application to read out a several
DRS4 evaluation board in daisy-chain mode
$Id: drs_exam_multi.cpp 21509 2014-10-15 10:11:36Z ritt $
\********************************************************************/
#include <math.h>
#ifdef _MSC_VER
#include <windows.h>
#elif defined(OS_LINUX)
#define O_BINARY 0
#include <unistd.h>
#include <ctype.h>
#include <sys/ioctl.h>
#include <errno.h>
#define DIR_SEPARATOR '/'
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "strlcpy.h"
#include "DRS.h"
/*------------------------------------------------------------------*/
int main()
{
int i, j, k;
DRS *drs;
DRSBoard *b, *mb;
float time_array[8][1024];
float wave_array[8][1024];
FILE *f;
/* do initial scan, sort boards accordning to their serial numbers */
drs = new DRS();
drs->SortBoards();
/* show any found board(s) */
for (i=0 ; i<drs->GetNumberOfBoards() ; i++) {
b = drs->GetBoard(i);
printf("Found DRS4 evaluation board, serial #%d, firmware revision %d\n",
b->GetBoardSerialNumber(), b->GetFirmwareVersion());
if (b->GetBoardType() < 8) {
printf("Found pre-V4 board, aborting\n");
return 0;
}
}
/* exit if no board found */
if (drs->GetNumberOfBoards() == 0) {
printf("No DRS4 evaluation board found\n");
return 0;
}
/* exit if only one board found */
if (drs->GetNumberOfBoards() == 1) {
printf("Only one DRS4 evaluation board found, please use drs_exam program\n");
return 0;
}
/* use first board with highest serial number as the master board */
mb = drs->GetBoard(0);
/* common configuration for all boards */
for (i=0 ; i<drs->GetNumberOfBoards() ; i++) {
b = drs->GetBoard(i);
/* initialize board */
b->Init();
/* select external reference clock for slave modules */
/* NOTE: this only works if the clock chain is connected */
if (i > 0) {
if (b->GetFirmwareVersion() >= 21260) { // this only works with recent firmware versions
if (b->GetScaler(5) > 300000) // check if external clock is connected
b->SetRefclk(true); // switch to external reference clock
}
}
/* set sampling frequency */
b->SetFrequency(5, true);
/* set input range to -0.5V ... +0.5V */
b->SetInputRange(0);
/* enable hardware trigger */
b->EnableTrigger(1, 0);
if (i == 0) {
/* master board: enable hardware trigger on CH1 at 50 mV positive edge */
b->SetTranspMode(1);
b->SetTriggerSource(1<<0); // set CH1 as source
b->SetTriggerLevel(0.05); // 50 mV
b->SetTriggerPolarity(false); // positive edge
b->SetTriggerDelayNs(0); // zero ns trigger delay
} else {
/* slave boards: enable hardware trigger on Trigger IN */
b->SetTriggerSource(1<<4); // set Trigger IN as source
b->SetTriggerPolarity(false); // positive edge
}
}
/* open file to save waveforms */
f = fopen("data.txt", "w");
if (f == NULL) {
perror("ERROR: Cannot open file \"data.txt\"");
return 1;
}
/* repeat ten times */
for (i=0 ; i<10 ; i++) {
/* start boards (activate domino wave), master is last */
for (j=drs->GetNumberOfBoards()-1 ; j>=0 ; j--)
drs->GetBoard(j)->StartDomino();
/* wait for trigger on master board */
printf("Waiting for trigger...");
fflush(stdout);
while (mb->IsBusy());
fprintf(f, "Event #%d =====================================================\n", j);
for (j=0 ; j<drs->GetNumberOfBoards() ; j++) {
b = drs->GetBoard(j);
if (b->IsBusy()) {
i--; /* skip that event, must be some fake trigger */
break;
}
/* read all waveforms from all boards */
b->TransferWaves(0, 8);
for (k=0 ; k<4 ; k++) {
/* read time (X) array in ns */
b->GetTime(0, k*2, b->GetTriggerCell(0), time_array[k]);
/* decode waveform (Y) arrays in mV */
b->GetWave(0, k*2, wave_array[k]);
}
/* Save waveform: X=time_array[i], Channel_n=wave_array[n][i] */
fprintf(f, "Board #%d ---------------------------------------------------\n t1[ns] u1[mV] t2[ns] u2[mV] t3[ns] u3[mV] t4[ns] u4[mV]\n", b->GetBoardSerialNumber());
for (k=0 ; k<1024 ; k++)
fprintf(f, "%7.3f %7.1f %7.3f %7.1f %7.3f %7.1f %7.3f %7.1f\n",
time_array[0][k], wave_array[0][k],
time_array[1][k], wave_array[1][k],
time_array[2][k], wave_array[2][k],
time_array[3][k], wave_array[3][k]);
}
/* print some progress indication */
printf("\rEvent #%d read successfully\n", i);
}
fclose(f);
printf("Program finished.\n");
/* delete DRS object -> close USB connection */
delete drs;
}
@@ -0,0 +1,305 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
D563FEB918643B6100F76DF2 /* averager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D563FEB818643B6100F76DF2 /* averager.cpp */; };
D5F6AF8814274CF7003299EE /* DRS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8714274CF7003299EE /* DRS.cpp */; };
D5F6AF8A14274D0F003299EE /* drs_exam_multi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8914274D0F003299EE /* drs_exam_multi.cpp */; };
D5F6AF8D14274D1F003299EE /* mxml.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8B14274D1F003299EE /* mxml.c */; };
D5F6AF8E14274D1F003299EE /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8C14274D1F003299EE /* strlcpy.c */; };
D5F6AF9014274D2E003299EE /* musbstd.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8F14274D2E003299EE /* musbstd.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
D5446429141E1BB40027AF52 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
D544642B141E1BB40027AF52 /* drs_exam_multi */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = drs_exam_multi; sourceTree = BUILT_PRODUCTS_DIR; };
D563FEB818643B6100F76DF2 /* averager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = averager.cpp; path = ../averager.cpp; sourceTree = "<group>"; };
D563FEBA18643B6B00F76DF2 /* averager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = averager.h; path = ../averager.h; sourceTree = "<group>"; };
D5F6AF8514274CE2003299EE /* DRS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DRS.h; path = ../DRS.h; sourceTree = "<group>"; };
D5F6AF8714274CF7003299EE /* DRS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DRS.cpp; path = ../DRS.cpp; sourceTree = "<group>"; };
D5F6AF8914274D0F003299EE /* drs_exam_multi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = drs_exam_multi.cpp; sourceTree = "<group>"; };
D5F6AF8B14274D1F003299EE /* mxml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mxml.c; path = ../../../../../mxml/mxml.c; sourceTree = "<group>"; };
D5F6AF8C14274D1F003299EE /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = ../../../../../mxml/strlcpy.c; sourceTree = "<group>"; };
D5F6AF8F14274D2E003299EE /* musbstd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = musbstd.c; path = ../../../../../midas/drivers/usb/musbstd.c; sourceTree = "<group>"; };
D5F6AF9114274D4C003299EE /* mxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mxml.h; path = ../../../../../mxml/mxml.h; sourceTree = "<group>"; };
D5F6AF9214274D4C003299EE /* strlcpy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strlcpy.h; path = ../../../../../mxml/strlcpy.h; sourceTree = "<group>"; };
D5F6AF9314274D61003299EE /* musbstd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = musbstd.h; path = ../../../../../midas/include/musbstd.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D5446428141E1BB40027AF52 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
D5446420141E1BB40027AF52 = {
isa = PBXGroup;
children = (
D5F6AF8414274CCC003299EE /* Header Files */,
D5F6AF8614274CE8003299EE /* Source Files */,
D544642C141E1BB40027AF52 /* Products */,
);
sourceTree = "<group>";
};
D544642C141E1BB40027AF52 /* Products */ = {
isa = PBXGroup;
children = (
D544642B141E1BB40027AF52 /* drs_exam_multi */,
);
name = Products;
sourceTree = "<group>";
};
D5F6AF8414274CCC003299EE /* Header Files */ = {
isa = PBXGroup;
children = (
D563FEBA18643B6B00F76DF2 /* averager.h */,
D5F6AF9314274D61003299EE /* musbstd.h */,
D5F6AF9114274D4C003299EE /* mxml.h */,
D5F6AF9214274D4C003299EE /* strlcpy.h */,
D5F6AF8514274CE2003299EE /* DRS.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
D5F6AF8614274CE8003299EE /* Source Files */ = {
isa = PBXGroup;
children = (
D563FEB818643B6100F76DF2 /* averager.cpp */,
D5F6AF8F14274D2E003299EE /* musbstd.c */,
D5F6AF8B14274D1F003299EE /* mxml.c */,
D5F6AF8C14274D1F003299EE /* strlcpy.c */,
D5F6AF8914274D0F003299EE /* drs_exam_multi.cpp */,
D5F6AF8714274CF7003299EE /* DRS.cpp */,
);
name = "Source Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D544642A141E1BB40027AF52 /* drs_exam_multi */ = {
isa = PBXNativeTarget;
buildConfigurationList = D5446435141E1BB40027AF52 /* Build configuration list for PBXNativeTarget "drs_exam_multi" */;
buildPhases = (
D5446427141E1BB40027AF52 /* Sources */,
D5446428141E1BB40027AF52 /* Frameworks */,
D5446429141E1BB40027AF52 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = drs_exam_multi;
productName = drs_exam_multi;
productReference = D544642B141E1BB40027AF52 /* drs_exam_multi */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D5446422141E1BB40027AF52 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0600;
ORGANIZATIONNAME = PSI;
};
buildConfigurationList = D5446425141E1BB40027AF52 /* Build configuration list for PBXProject "drs_exam_multi" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = D5446420141E1BB40027AF52;
productRefGroup = D544642C141E1BB40027AF52 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D544642A141E1BB40027AF52 /* drs_exam_multi */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
D5446427141E1BB40027AF52 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5F6AF8814274CF7003299EE /* DRS.cpp in Sources */,
D5F6AF8A14274D0F003299EE /* drs_exam_multi.cpp in Sources */,
D563FEB918643B6100F76DF2 /* averager.cpp in Sources */,
D5F6AF8D14274D1F003299EE /* mxml.c in Sources */,
D5F6AF8E14274D1F003299EE /* strlcpy.c in Sources */,
D5F6AF9014274D2E003299EE /* musbstd.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
D5446433141E1BB40027AF52 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
D5446434141E1BB40027AF52 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx;
};
name = Release;
};
D5446436141E1BB40027AF52 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
OS_LINUX,
HAVE_USB,
HAVE_LIBUSB10,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/mxml,
/midas/include,
../,
/usr/local/include,
"/usr/local/include/libusb-1.0",
);
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"-lusb-1.0",
"-framework",
IOKit,
"-framework",
Carbon,
);
PRELINK_LIBS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
D5446437141E1BB40027AF52 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/mxml,
/midas/include,
../,
/usr/local/include,
"/usr/local/include/libusb-1.0",
);
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"-lusb-1.0",
"-framework",
IOKit,
"-framework",
Carbon,
);
PRELINK_LIBS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D5446425141E1BB40027AF52 /* Build configuration list for PBXProject "drs_exam_multi" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D5446433141E1BB40027AF52 /* Debug */,
D5446434141E1BB40027AF52 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D5446435141E1BB40027AF52 /* Build configuration list for PBXNativeTarget "drs_exam_multi" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D5446436141E1BB40027AF52 /* Debug */,
D5446437141E1BB40027AF52 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D5446422141E1BB40027AF52 /* Project object */;
}
+83
View File
@@ -0,0 +1,83 @@
/********************************************************************\
Name: drs_scaler.cpp
Created by: Stefan Ritt
Contents: Wrapper function to read scalers via Labview
$Id: drs_scaler.cpp 21293 2014-03-19 16:36:44Z ritt $
\********************************************************************/
#include <math.h>
#ifdef _MSC_VER
#include <windows.h>
#elif defined(OS_LINUX)
#include <unistd.h>
#include <ctype.h>
#include <sys/ioctl.h>
#include <errno.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "DRS.h"
#if defined(_MSC_VER)
#define EXPRT __declspec(dllexport)
#else
#define EXPRT
#endif
#ifdef __cplusplus
extern "C" {
#endif
void EXPRT scaler(unsigned int *s1, unsigned int *s2, unsigned int *s3, unsigned int *s4);
#ifdef __cplusplus
};
#endif
/*------------------------------------------------------------------*/
void scaler(unsigned int *s1, unsigned int *s2, unsigned int *s3, unsigned int *s4)
{
static DRS *drs = NULL;
if (drs == NULL) {
drs = new DRS();
}
if (drs->GetNumberOfBoards()> 0) {
DRSBoard *b = drs->GetBoard(0);
*s1 = b->GetScaler(0);
*s2 = b->GetScaler(1);
*s3 = b->GetScaler(2);
*s4 = b->GetScaler(3);
} else {
*s1 = -1;
*s2 = -1;
*s3 = -1;
*s4 = -1;
}
}
/*------------------------------------------------------------------*/
int main()
{
unsigned int s1, s2, s3, s4;
scaler(&s1, &s2, &s3, &s4);
printf("%d %d %d %d\n", s1, s2, s3, s4);
return 1;
}
+20
View File
@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drs_scaler", "drs_scaler.vcxproj", "{90E7F6F9-F0C2-4512-95C1-83DA0109D903}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{90E7F6F9-F0C2-4512-95C1-83DA0109D903}.Debug|Win32.ActiveCfg = Debug|Win32
{90E7F6F9-F0C2-4512-95C1-83DA0109D903}.Debug|Win32.Build.0 = Debug|Win32
{90E7F6F9-F0C2-4512-95C1-83DA0109D903}.Release|Win32.ActiveCfg = Release|Win32
{90E7F6F9-F0C2-4512-95C1-83DA0109D903}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+98
View File
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{90E7F6F9-F0C2-4512-95C1-83DA0109D903}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>drs_scaler</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DRS_SCALER_EXPORTS;HAVE_LIBUSB10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>c:\midas\include;c:\mxml;c:\meg\online\drivers\drs;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DRS_SCALER_EXPORTS;HAVE_LIBUSB10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>c:\midas\include;c:\mxml;c:\meg\online\drivers\drs;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\..\..\midas\drivers\usb\musbstd.c" />
<ClCompile Include="..\..\..\..\..\..\mxml\mxml.c" />
<ClCompile Include="..\..\..\..\..\..\mxml\strlcpy.c" />
<ClCompile Include="..\averager.cpp" />
<ClCompile Include="..\DRS.cpp" />
<ClCompile Include="drs_scaler.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\..\..\..\midas\include\musbstd.h" />
<ClInclude Include="..\..\..\..\..\..\mxml\mxml.h" />
<ClInclude Include="..\..\..\..\..\..\mxml\strlcpy.h" />
<ClInclude Include="..\DRS.h" />
</ItemGroup>
<ItemGroup>
<Library Include="..\libusb-1.0\libusb-1.0.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
File diff suppressed because it is too large Load Diff
+20
View File
@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drscl", "drscl.vcxproj", "{0A260864-8525-423F-984D-34C5BE6EDE0A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Debug|Win32.ActiveCfg = Debug|Win32
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Debug|Win32.Build.0 = Debug|Win32
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Release|Win32.ActiveCfg = Release|Win32
{0A260864-8525-423F-984D-34C5BE6EDE0A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+273
View File
@@ -0,0 +1,273 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="drscl"
ProjectGUID="{0A260864-8525-423F-984D-34C5BE6EDE0A}"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/drscl.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\meg\online\drivers\drs\libusb\include;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_USB;HAVE_LIBUSB;CF_VIA_USBx;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_VME"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/drscl.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="2055"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Release/drscl.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/drscl.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/drscl.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\meg\online\drivers\drs\libusb\include;c:\midas\mscb\"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_USB;HAVE_LIBUSB;HAVE_VME"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/drscl.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="2055"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib"
OutputFile=".\Debug/drscl.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/drscl.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\ace\ace.c"
>
</File>
<File
RelativePath="..\DRS.cpp"
>
</File>
<File
RelativePath=".\drscl.cpp"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\drivers\usb\musbstd.c"
>
</File>
<File
RelativePath="..\..\..\..\..\mxml\mxml.c"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\drivers\vme\sis3100\sis3100.c"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\drivers\vme\sis3100\windows\sis3100_vme_calls.c"
>
</File>
<File
RelativePath="..\..\..\..\..\mxml\strlcpy.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\ace\ace.h"
>
</File>
<File
RelativePath="..\DRS.h"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\include\musbstd.h"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\include\mvmestd.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath="..\libusb\lib\libusb.lib"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\Nt\lib\sis1100w.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+152
View File
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0A260864-8525-423F-984D-34C5BE6EDE0A}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/drscl.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\meg\online\drivers\drs\libusb\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;HAVE_USB;HAVE_LIBUSB10;CF_VIA_USBx;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Release/drscl.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0807</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/drscl.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/drscl.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/drscl.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>C:\meg\online\drivers\drs;c:\midas\include;c:\mxml;c:\midas\drivers\vme\sis3100\windows\;c:\meg\online\drivers\ace\;c:\midas\mscb\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_USB;HAVE_LIBUSB10;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderOutputFile>.\Debug/drscl.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0807</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\Debug/drscl.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/drscl.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>LIBCMT.lib</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\averager.cpp" />
<ClCompile Include="..\DRS.cpp" />
<ClCompile Include="drscl.cpp" />
<ClCompile Include="..\..\..\..\..\midas\drivers\usb\musbstd.c" />
<ClCompile Include="..\..\..\..\..\mxml\mxml.c" />
<ClCompile Include="..\..\..\..\..\mxml\strlcpy.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\averager.h" />
<ClInclude Include="..\DRS.h" />
<ClInclude Include="..\..\..\..\..\midas\include\musbstd.h" />
</ItemGroup>
<ItemGroup>
<Library Include="..\libusb-1.0\libusb-1.0.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+53
View File
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{58f8d010-21b2-4ac0-a39a-e1555568fe0e}</UniqueIdentifier>
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{7cce5796-2a2f-4002-adfd-2c2273b69bba}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{1162d07e-0108-49af-ae80-5a4e0cb26468}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\DRS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="drscl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\midas\drivers\usb\musbstd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\mxml\mxml.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\mxml\strlcpy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\averager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\DRS.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\midas\include\musbstd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\averager.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Library Include="..\libusb-1.0\libusb-1.0.lib">
<Filter>Resource Files</Filter>
</Library>
</ItemGroup>
</Project>
@@ -0,0 +1,306 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
D5438C1718632BB1006A17E5 /* averager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5438C1618632BB1006A17E5 /* averager.cpp */; };
D5F6AF8814274CF7003299EE /* DRS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8714274CF7003299EE /* DRS.cpp */; };
D5F6AF8A14274D0F003299EE /* drscl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8914274D0F003299EE /* drscl.cpp */; };
D5F6AF8D14274D1F003299EE /* mxml.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8B14274D1F003299EE /* mxml.c */; };
D5F6AF8E14274D1F003299EE /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8C14274D1F003299EE /* strlcpy.c */; };
D5F6AF9014274D2E003299EE /* musbstd.c in Sources */ = {isa = PBXBuildFile; fileRef = D5F6AF8F14274D2E003299EE /* musbstd.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
D5446429141E1BB40027AF52 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
D5438C1618632BB1006A17E5 /* averager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = averager.cpp; path = /drs4eb/software/src/averager.cpp; sourceTree = "<group>"; };
D5438C1818632BC1006A17E5 /* averager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = averager.h; path = /drs4eb/software/include/averager.h; sourceTree = "<group>"; };
D544642B141E1BB40027AF52 /* drscl */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = drscl; sourceTree = BUILT_PRODUCTS_DIR; };
D5F6AF8514274CE2003299EE /* DRS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DRS.h; path = /drs4eb/software/include/DRS.h; sourceTree = "<group>"; };
D5F6AF8714274CF7003299EE /* DRS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DRS.cpp; path = /drs4eb/software/src/DRS.cpp; sourceTree = "<group>"; };
D5F6AF8914274D0F003299EE /* drscl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = drscl.cpp; sourceTree = "<group>"; };
D5F6AF8B14274D1F003299EE /* mxml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mxml.c; path = /drs4eb/software/src/mxml.c; sourceTree = "<group>"; };
D5F6AF8C14274D1F003299EE /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = /drs4eb/software/src/strlcpy.c; sourceTree = "<group>"; };
D5F6AF8F14274D2E003299EE /* musbstd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = musbstd.c; path = /drs4eb/software/src/musbstd.c; sourceTree = "<group>"; };
D5F6AF9114274D4C003299EE /* mxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mxml.h; path = /drs4eb/software/include/mxml.h; sourceTree = "<group>"; };
D5F6AF9214274D4C003299EE /* strlcpy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strlcpy.h; path = /drs4eb/software/include/strlcpy.h; sourceTree = "<group>"; };
D5F6AF9314274D61003299EE /* musbstd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = musbstd.h; path = /drs4eb/software/include/musbstd.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D5446428141E1BB40027AF52 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
D5446420141E1BB40027AF52 = {
isa = PBXGroup;
children = (
D5F6AF8414274CCC003299EE /* Header Files */,
D5F6AF8614274CE8003299EE /* Source Files */,
D544642C141E1BB40027AF52 /* Products */,
);
sourceTree = "<group>";
};
D544642C141E1BB40027AF52 /* Products */ = {
isa = PBXGroup;
children = (
D544642B141E1BB40027AF52 /* drscl */,
);
name = Products;
sourceTree = "<group>";
};
D5F6AF8414274CCC003299EE /* Header Files */ = {
isa = PBXGroup;
children = (
D5438C1818632BC1006A17E5 /* averager.h */,
D5F6AF9314274D61003299EE /* musbstd.h */,
D5F6AF9114274D4C003299EE /* mxml.h */,
D5F6AF9214274D4C003299EE /* strlcpy.h */,
D5F6AF8514274CE2003299EE /* DRS.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
D5F6AF8614274CE8003299EE /* Source Files */ = {
isa = PBXGroup;
children = (
D5438C1618632BB1006A17E5 /* averager.cpp */,
D5F6AF8F14274D2E003299EE /* musbstd.c */,
D5F6AF8B14274D1F003299EE /* mxml.c */,
D5F6AF8C14274D1F003299EE /* strlcpy.c */,
D5F6AF8914274D0F003299EE /* drscl.cpp */,
D5F6AF8714274CF7003299EE /* DRS.cpp */,
);
name = "Source Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D544642A141E1BB40027AF52 /* drscl */ = {
isa = PBXNativeTarget;
buildConfigurationList = D5446435141E1BB40027AF52 /* Build configuration list for PBXNativeTarget "drscl" */;
buildPhases = (
D5446427141E1BB40027AF52 /* Sources */,
D5446428141E1BB40027AF52 /* Frameworks */,
D5446429141E1BB40027AF52 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = drscl;
productName = drscl;
productReference = D544642B141E1BB40027AF52 /* drscl */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D5446422141E1BB40027AF52 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = PSI;
};
buildConfigurationList = D5446425141E1BB40027AF52 /* Build configuration list for PBXProject "drscl" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = D5446420141E1BB40027AF52;
productRefGroup = D544642C141E1BB40027AF52 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D544642A141E1BB40027AF52 /* drscl */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
D5446427141E1BB40027AF52 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5F6AF8814274CF7003299EE /* DRS.cpp in Sources */,
D5F6AF8A14274D0F003299EE /* drscl.cpp in Sources */,
D5438C1718632BB1006A17E5 /* averager.cpp in Sources */,
D5F6AF8D14274D1F003299EE /* mxml.c in Sources */,
D5F6AF8E14274D1F003299EE /* strlcpy.c in Sources */,
D5F6AF9014274D2E003299EE /* musbstd.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
D5446433141E1BB40027AF52 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
D5446434141E1BB40027AF52 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
SDKROOT = macosx;
};
name = Release;
};
D5446436141E1BB40027AF52 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
OS_LINUX,
HAVE_USB,
HAVE_LIBUSB10,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/usr/local/include,
/drs4eb/software/include,
);
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"-lusb-1.0",
"-framework",
IOKit,
"-framework",
Carbon,
);
PRELINK_LIBS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
D5446437141E1BB40027AF52 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/usr/local/include,
/drs4eb/software/include,
);
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"-lusb-1.0",
"-framework",
IOKit,
"-framework",
Carbon,
);
PRELINK_LIBS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D5446425141E1BB40027AF52 /* Build configuration list for PBXProject "drscl" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D5446433141E1BB40027AF52 /* Debug */,
D5446434141E1BB40027AF52 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D5446435141E1BB40027AF52 /* Build configuration list for PBXNativeTarget "drscl" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D5446436141E1BB40027AF52 /* Debug */,
D5446437141E1BB40027AF52 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D5446422141E1BB40027AF52 /* Project object */;
}
+26
View File
@@ -0,0 +1,26 @@
/*
* AboutDialog.cpp
* About Dialog class
* $Id: AboutDialog.cpp 21911 2015-11-23 07:31:04Z ritt $
*/
#include "DRSOscInc.h"
extern char svn_revision[];
extern char drsosc_version[];
AboutDialog::AboutDialog(wxWindow* parent)
:
AboutDialog_fb( parent )
{
wxString str;
char d[80];
str.Printf(wxT("Version %s"), (const wxChar*)wxString::FromAscii(drsosc_version));
m_stVersion->SetLabel(str);
strcpy(d, svn_revision+23);
d[10] = 0;
str.Printf(wxT("Build %d, %s"), atoi(svn_revision+17), (const wxChar*)wxString::FromAscii(d));
m_stBuild->SetLabel(str);
}
+19
View File
@@ -0,0 +1,19 @@
#ifndef __AboutDialog__
#define __AboutDialog__
// $Id: AboutDialog.h 14011 2009-08-06 11:34:04Z ritt $
/**
@file
Subclass of AboutDialog_fb, which is generated by wxFormBuilder.
*/
/** Implementing ConfigDialog_fb */
class AboutDialog : public AboutDialog_fb
{
public:
/** Constructor */
AboutDialog( wxWindow* parent );
};
#endif // __AboutDialog__
+581
View File
@@ -0,0 +1,581 @@
/*
* ConfigDialog.cpp
* Modeless Configuration Dialog class
* $Id: ConfigDialog.cpp 22325 2016-10-07 14:05:49Z ritt $
*/
#include "DRSOscInc.h"
ConfigDialog::ConfigDialog( wxWindow* parent )
:
ConfigDialog_fb( parent )
{
m_frame = (DOFrame *)parent;
m_osci = m_frame->GetOsci();
fCalMode = 0;
m_board = 0;
m_firstChannel = 0;
m_chnSection = m_frame->GetOsci()->GetChnSection();
if (m_frame->GetMultiBoard()) {
m_cbMulti->SetValue(true);
m_cbTrgCorr->SetValue(false);
m_cbTrgCorr->Enable(false);
m_frame->SetDisplayTrgCorr(false);
}
m_cbClkOn->SetValue(m_frame->GetClkOn());
if (m_osci->GetNumberOfBoards() == 0) {
m_cbClkOn->SetLabel(wxT("Connect reference clock to channel #4"));
} else {
if (m_frame->GetOsci()->GetBoard(0)->GetBoardType() == 9)
m_cbClkOn->SetLabel(wxT("Connect reference clock to all channels"));
else
m_cbClkOn->SetLabel(wxT("Connect reference clock to channel #4"));
}
if (m_frame->GetRange() == 0) {
m_rbRange->SetSelection(0);
m_slCal->SetRange(-500, 500);
} else if (m_frame->GetRange() == 0.45) {
m_rbRange->SetSelection(1);
m_slCal->SetRange(-50, 950);
} else if (m_frame->GetRange() == 0.5) {
m_rbRange->SetSelection(2);
m_slCal->SetRange(-0, 1000);
}
if (m_chnSection == 2)
m_rbChHalf->SetSelection(2);
wxString wxstr;
wxstr.Printf(wxT("%1.4lg"), m_frame->GetReqSamplingSpeed());
m_tbFreq->SetValue(wxstr);
wxstr.Printf(wxT("%1.4lg GSPS"), m_frame->GetActSamplingSpeed());
m_stActFreq->SetLabel(wxstr);
m_cbLocked->SetValue(m_frame->IsFreqLocked());
m_cbSpikes->SetValue(m_frame->GetSpikeRemovel());
if (m_osci->GetNumberOfBoards() == 0) {
m_cbTCalOn->SetValue(true);
m_cbTCalOn->Enable(true);
} else {
m_cbTCalOn->SetValue(m_frame->GetOsci()->IsTCalibrated());
m_cbTCalOn->Enable(m_frame->GetOsci()->IsTCalibrated());
}
PopulateBoards();
}
void ConfigDialog::PopulateBoards()
{
wxString wxstr;
m_cbBoard->Clear();
for (int i=0 ; i<m_osci->GetNumberOfBoards() ; i++) {
DRSBoard *b = m_osci->GetBoard(i);
#ifdef HAVE_VME
if (b->GetTransport() == 1)
wxstr.Printf(wxT("VME DRS%d slot %2d%s serial %d"),
b->GetDRSType(), (b->GetSlotNumber() >> 1)+2,
((b->GetSlotNumber() & 1) == 0) ? "up" : "lo",
b->GetBoardSerialNumber());
else
#endif
wxstr.Printf(wxT("USB DRS%d serial %d"), b->GetDRSType(), b->GetBoardSerialNumber());
m_cbBoard->Append(wxstr);
}
m_cbBoard->Select(m_board);
UpdateControls();
}
void ConfigDialog::UpdateControls()
{
if (m_osci->GetNumberOfBoards() < 2) {
m_cbMulti->Enable(false);
} else
m_cbMulti->Enable(true);
if (m_osci->GetNumberOfBoards() == 0 ||
m_osci->GetBoard(m_board)->GetBoardType() == 5 ||
m_osci->GetBoard(m_board)->GetBoardType() == 7 ||
m_osci->GetBoard(m_board)->GetBoardType() == 8 ||
m_osci->GetBoard(m_board)->GetBoardType() == 9) {
if (m_osci->GetNumberOfBoards() > 0) {
m_cbExtRefclk->Enable(m_osci->GetBoard(m_board)->GetBoardType() == 8 || m_osci->GetBoard(m_board)->GetBoardType() == 9);
m_cbExtRefclk->Show(m_osci->GetBoard(m_board)->GetBoardType() == 8 || m_osci->GetBoard(m_board)->GetBoardType() == 9);
}
} else {
m_cbExtRefclk->Enable(true);
m_cbExtRefclk->Show(true);
}
if (m_osci->GetNumberOfBoards() > 0) {
if (m_osci->GetBoard(m_board)->GetBoardType() == 5 ||
m_osci->GetBoard(m_board)->GetBoardType() == 6 ||
m_osci->GetBoard(m_board)->Is2048ModeCapable()) {
m_rbChHalf->Enable(true);
} else {
if (m_osci->GetBoard(m_board)->GetBoardSerialNumber() == 2146 ||
m_osci->GetBoard(m_board)->GetBoardSerialNumber() == 2205 ||
m_osci->GetBoard(m_board)->GetBoardSerialNumber() == 2208 ||
m_osci->GetBoard(m_board)->GetBoardSerialNumber() == 2253 ||
m_osci->GetBoard(m_board)->GetBoardSerialNumber() == 2287) {
m_rbChHalf->Enable(true); // special boards modified for RFBeta & Slow Muons
} else {
m_rbChHalf->Enable(false);
}
}
} else {
m_rbChHalf->Enable(false);
}
if (m_osci->GetNumberOfBoards() == 0) {
m_cbTCalOn->SetValue(true);
m_cbTCalOn->Enable(true);
} else {
m_cbCalibrated->SetValue(m_frame->GetOsci()->IsVCalibrated());
m_cbCalibrated->Enable(m_frame->GetOsci()->IsVCalibrated());
m_cbCalibrated2->SetValue(m_frame->GetOsci()->IsVCalibrated());
m_cbCalibrated2->Enable(m_frame->GetOsci()->IsVCalibrated());
m_cbTCalOn->SetValue(m_frame->GetOsci()->IsTCalibrated());
m_cbTCalOn->Enable(m_frame->GetOsci()->IsTCalibrated());
m_cbExtRefclk->SetValue(m_osci->GetBoard(m_board)->GetRefclk() == 1);
if ((m_osci->GetBoard(m_board)->GetBoardType() == 8 || m_osci->GetBoard(m_board)->GetBoardType() == 9)
&& (!m_osci->IsMultiBoard() || m_board == 0))
m_frame->EnableTriggerConfig(true);
else
m_frame->EnableTriggerConfig(false);
}
}
void ConfigDialog::OnBoardSelect( wxCommandEvent& event )
{
if (event.GetId() == ID_MULTI) {
if (m_cbMulti->IsChecked()) {
wxString str;
str.Printf(wxT("In a multi-board configuration, the Trigger and Clock singals must be conected. Please read the manual for details. Turn on multi-board mode?"));
if (wxMessageBox(str, wxT("DRS Oscilloscope Info"), wxOK | wxCANCEL | wxICON_EXCLAMATION) == wxOK) {
m_osci->Enable(false);
m_osci->SetMultiBoard(true);
for (int i=1 ; i<m_osci->GetNumberOfBoards() ; i++) {
DRSBoard *b = m_frame->GetOsci()->GetBoard(i);
m_frame->SetTriggerSource(i, 4); // select external trigger
m_frame->SetTriggerPolarity(i, false); // positive trigger
if (b->GetFirmwareVersion() < 21260) {
wxMessageBox(wxT("For this operation V5 boards with firmware revision >= 21260 is required"),
wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
} else {
if (b->GetScaler(5) < 300000) {
str.Printf(wxT("No clock signal connected to CLK IN of board #%d"), i);
wxMessageBox(str, wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
m_frame->SetRefclk(i, false);
} else {
m_frame->SetRefclk(i, true);
}
}
}
m_osci->Enable(true);
m_osci->SelectBoard(m_board);
m_osci->SelectChannel(m_firstChannel, m_chnSection);
m_frame->SetDisplayTrgCorr(false);
m_cbTrgCorr->SetValue(false);
m_cbTrgCorr->Enable(false);
} else {
m_cbMulti->SetValue(false);
}
} else {
m_osci->Enable(false);
m_osci->SetMultiBoard(false);
m_osci->Enable(true);
m_osci->SelectBoard(m_board);
m_osci->SelectChannel(m_firstChannel, m_chnSection);
m_cbTrgCorr->Enable(true);
}
m_frame->SetMultiBoard(m_cbMulti->IsChecked());
m_frame->SelectBoard(m_board); // cause control update
if (!m_cbMulti->IsChecked())
m_frame->SetSplitMode(false);
} else {
m_board = m_cbBoard->GetSelection();
m_osci->SelectBoard(m_board);
m_osci->SelectChannel(m_firstChannel, m_chnSection);
m_frame->SelectBoard(m_board);
UpdateControls();
}
}
// called from DOFrame if one selects another board
void ConfigDialog::SelectBoard(int i)
{
m_board = i;
m_cbBoard->SetSelection(i);
m_osci->SelectBoard(m_board);
m_osci->SelectChannel(m_firstChannel, m_chnSection);
m_frame->UpdateStatusBar();
UpdateControls();
}
void ConfigDialog::OnRescan( wxCommandEvent& event )
{
m_frame->EnableEPThread(false);
m_osci->ScanBoards();
PopulateBoards();
if (m_board >= m_osci->GetNumberOfBoards())
m_board = m_firstChannel = m_chnSection = 0;
m_osci->SelectBoard(m_board);
m_frame->EnableEPThread(true);
m_frame->UpdateStatusBar();
}
void ConfigDialog::OnInfo( wxCommandEvent& event )
{
InfoDialog id(m_frame);
id.ShowModal();
}
void ConfigDialog::OnChannelHalf( wxCommandEvent& event )
{
if (event.GetId() == ID_CH_HALF)
m_chnSection = m_rbChHalf->GetSelection();
m_frame->SetSource(m_board, m_firstChannel, m_chnSection);
m_osci->SelectBoard(m_board);
m_osci->SelectChannel(m_firstChannel, m_chnSection);
}
void ConfigDialog::OnInputRange( wxCommandEvent& event )
{
if (m_rbRange->GetSelection() == 0) {
m_frame->GetOsci()->SetInputRange(0);
m_frame->SetRange(0);
m_slCal->SetRange(-500, 500);
} else if (m_rbRange->GetSelection() == 1) {
m_frame->GetOsci()->SetInputRange(0.45);
m_frame->SetRange(0.45);
m_slCal->SetRange(-50, 950);
} else if (m_rbRange->GetSelection() == 2) {
m_frame->GetOsci()->SetInputRange(0.5);
m_frame->SetRange(0.5);
m_slCal->SetRange(0, 1000);
}
OnCalEnter(event);
}
void ConfigDialog::OnCalOn( wxCommandEvent& event )
{
if (event.IsChecked()) {
m_frame->GetOsci()->SetCalibVoltage(true, m_slCal->GetValue()/1000.0);
} else {
m_frame->GetOsci()->SetCalibVoltage(false, 0);
}
}
void ConfigDialog::OnCalEnter( wxCommandEvent& event )
{
if (!m_teCal->IsEmpty()) {
long value;
m_teCal->GetValue().ToLong(&value);
if (m_frame->GetRange() == 0) {
if (value < -500)
value = -500;
if (value > 500)
value = 500;
} else if (m_frame->GetRange() == 0.45) {
if (value < -50)
value = -50;
if (value > 950)
value = 950;
} else if (m_frame->GetRange() == 0.5) {
if (value < 0)
value = 0;
if (value > 1000)
value = 1000;
}
m_slCal->SetValue(value);
m_teCal->SetValue(wxString::Format(wxT("%ld"), value));
if (m_cbCalOn->IsChecked())
m_frame->GetOsci()->SetCalibVoltage(true, value/1000.0);
}
/* check for calibration */
if (m_osci->GetNumberOfBoards() > 0 &&
fabs(m_frame->GetRange() - m_frame->GetOsci()->GetCalibratedInputRange()) > 0.001) {
wxString str;
str.Printf(wxT("This board was calibrated for an input range of\n %1.2lg V ... %1.2lg V\nYou must execute a new voltage calibration to use this board for the new input range"),
m_frame->GetOsci()->GetCalibratedInputRange()-0.5, m_frame->GetOsci()->GetCalibratedInputRange()+0.5);
wxMessageBox(str, wxT("DRS Oscilloscope Warning"), wxOK | wxICON_EXCLAMATION, this);
}
}
void ConfigDialog::OnCalSlider( wxScrollEvent& event )
{
m_teCal->SetValue(wxString::Format(wxT("%d"), m_slCal->GetValue()));
if (m_cbCalOn->IsChecked())
m_frame->GetOsci()->SetCalibVoltage(true, m_slCal->GetValue()/1000.0);
}
void ConfigDialog::Progress(int prog)
{
if (fCalMode == 1)
m_gaugeCalVolt->SetValue(prog);
else {
m_gaugeCalTime->SetValue(prog);
m_frame->SetProgress(prog);
m_frame->Refresh();
m_frame->Update();
}
/* produces flickers with V 2.9.2
this->Refresh();
this->Update(); */
}
void ConfigDialog::OnButtonCalVolt( wxCommandEvent& event )
{
fCalMode = 1;
if (m_frame->GetOsci()->GetNumberOfBoards()) {
m_frame->GetTimer()->Stop();
m_frame->GetOsci()->Enable(false); // turn off readout thread
DRSBoard *b = m_frame->GetOsci()->GetCurrentBoard();
if (b->GetTransport() == TR_USB2 && b->GetBoardType() == 6) {
wxMessageBox(wxT("Voltage calibration not possible with Mezzanine Board through USB"),
wxT("DRS Oscilloscope Error"), wxOK | wxICON_STOP, this);
return;
}
wxMessageBox(wxT("Please disconnect any signal from input to continue calibration"),
wxT("DRS Oscilloscope Info"), wxOK | wxICON_INFORMATION, this);
m_frame->Refresh();
m_frame->Update();
/* remember current settings */
double acalVolt = b->GetAcalVolt();
int acalMode = b->GetAcalMode();
int tcalFreq = b->GetTcalFreq();
int tcalLevel = b->GetTcalLevel();
int tcalSource = b->GetTcalSource();
int flag1 = b->GetTriggerEnable(0);
int flag2 = b->GetTriggerEnable(1);
int trgSource = b->GetTriggerSource();
int trgDelay = b->GetTriggerDelay();
double range = b->GetInputRange();
int config = b->GetReadoutChannelConfig();
int casc = b->GetChannelCascading();
wxBusyCursor cursor;
b->CalibrateVolt(this);
/* restore old values */
b->EnableAcal(acalMode, acalVolt);
b->EnableTcal(tcalFreq, tcalLevel);
b->SelectClockSource(tcalSource);
b->EnableTrigger(flag1, flag2);
b->SetTriggerSource(trgSource);
b->SetTriggerDelayPercent(trgDelay);
b->SetInputRange(range);
if (casc == 2)
b->SetChannelConfig(config, 8, 4);
else
b->SetChannelConfig(config, 8, 8);
if (b->GetBoardType() == 5)
b->SetTranspMode(1); // Evaluation board with build-in trigger
else
b->SetTranspMode(1); // VPC Mezzanine board
UpdateControls();
m_frame->GetTimer()->Start(100);
m_frame->GetOsci()->Start();
m_frame->GetOsci()->Enable(true);
}
Progress(0);
}
void ConfigDialog::OnButtonCalTime( wxCommandEvent& event )
{
fCalMode = 2;
if (m_frame->GetOsci()->GetNumberOfBoards()) {
if (m_frame->GetOsci()->GetCurrentBoard()->GetFirmwareVersion() < 13279)
wxMessageBox(wxT("Firmware revision 13279 or later\nrequired for timing calibration"),
wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
else if (m_frame->GetOsci()->GetInputRange() != 0)
wxMessageBox(wxT("Timing calibration can only be done\nat the -0.5V to +0.5V input range"),
wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
else {
DRSBoard *b = m_frame->GetOsci()->GetCurrentBoard();
m_frame->GetOsci()->Enable(false); // turn off readout thread
/* remember current settings */
double acalVolt = b->GetAcalVolt();
int acalMode = b->GetAcalMode();
int tcalFreq = b->GetTcalFreq();
int tcalLevel = b->GetTcalLevel();
int tcalSource = b->GetTcalSource();
int flag1 = b->GetTriggerEnable(0);
int flag2 = b->GetTriggerEnable(1);
int trgSource = b->GetTriggerSource();
int trgDelay = b->GetTriggerDelay();
double range = b->GetInputRange();
int config = b->GetReadoutChannelConfig();
m_frame->SetPaintMode(kPMTimeCalibration);
wxBusyCursor cursor;
int status = b->CalibrateTiming(this);
if (!status)
wxMessageBox(wxT("Error performing timing calibration, please check waveforms and redo voltage calibration."),
wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
else
wxMessageBox(wxT("Timing calibration successfully finished."),
wxT("DRS Oscilloscope"), wxOK, this);
m_frame->SetPaintMode(kPMWaveform);
/* restore old values */
b->EnableAcal(acalMode, acalVolt);
b->EnableTcal(tcalFreq, tcalLevel);
b->SelectClockSource(tcalSource);
b->EnableTrigger(flag1, flag2);
b->SetTriggerSource(trgSource);
b->SetTriggerDelayPercent(trgDelay);
b->SetInputRange(range);
b->SetChannelConfig(config, 8, 8);
if (b->GetBoardType() == 5)
b->SetTranspMode(1); // Evaluation board with build-in trigger
else
b->SetTranspMode(1); // VPC Mezzanine board
FreqChange(); // update enable flag for timing calibration check box
m_frame->GetTimer()->Start(100);
m_frame->GetOsci()->Start();
m_frame->GetOsci()->Enable(true);
}
Progress(0);
}
}
void ConfigDialog::OnClkOn( wxCommandEvent& event )
{
m_frame->SetClkOn(event.IsChecked());
}
void ConfigDialog::OnDateTime( wxCommandEvent& event )
{
m_frame->SetDisplayDateTime(event.IsChecked());
}
void ConfigDialog::OnShowGrid( wxCommandEvent& event )
{
m_frame->SetDisplayShowGrid(event.IsChecked());
}
void ConfigDialog::OnDisplayWaveforms( wxCommandEvent& event )
{
if (event.GetId() == ID_DISP_CALIBRATED)
m_frame->SetDisplayCalibrated(event.IsChecked());
if (event.GetId() == ID_DISP_CALIBRATED2)
m_frame->SetDisplayCalibrated2(event.IsChecked());
if (event.GetId() == ID_DISP_ROTATED)
m_frame->SetDisplayRotated(event.IsChecked());
if (event.GetId() == ID_DISP_TCALIBRATED)
m_frame->SetDisplayTCalOn(event.IsChecked());
if (event.GetId() == ID_DISP_TRGCORR)
m_frame->SetDisplayTrgCorr(event.IsChecked());
if (event.GetId() == ID_REFCLK) {
if (event.IsChecked()) {
// check if clock is connected to CLK in
if (m_frame->GetOsci()->GetNumberOfBoards() > 0) {
if (m_frame->GetOsci()->GetCurrentBoard()->GetFirmwareVersion() < 21260) {
wxMessageBox(wxT("For this operation a V5 board with firmware revision >= 21260 is required"),
wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
m_cbExtRefclk->SetValue(false);
} else {
if (m_frame->GetOsci()->GetScaler(5) < 300000) {
wxMessageBox(wxT("No clock signal connected to CLK IN"),
wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
m_cbExtRefclk->SetValue(false);
} else
m_frame->SetRefclk(m_board, true);
}
}
} else
m_frame->SetRefclk(m_board, false);
FreqChange();
}
}
void ConfigDialog::OnRemoveSpikes( wxCommandEvent& event )
{
m_frame->SetSpikeRemoval(event.IsChecked());
}
void ConfigDialog::FreqChange()
{
wxString wxstr;
wxstr.Printf(wxT("%1.4lg"), m_frame->GetReqSamplingSpeed());
m_tbFreq->SetValue(wxstr);
wxstr.Printf(wxT("%1.4lg GSPS"), m_frame->GetActSamplingSpeed());
m_stActFreq->SetLabel(wxstr);
if (m_osci->GetNumberOfBoards() == 0) {
m_cbTCalOn->SetValue(true);
m_cbTCalOn->Enable(true);
} else {
m_cbTCalOn->SetValue(m_frame->GetOsci()->IsTCalibrated());
m_cbTCalOn->Enable(m_frame->GetOsci()->IsTCalibrated());
}
}
void ConfigDialog::OnFreq( wxCommandEvent& event )
{
wxString wxstr = m_tbFreq->GetValue();
double freq = 0;
wxstr.ToDouble(&freq);
m_frame->SetSamplingSpeed(freq);
wxstr.Printf(wxT("%1.4lg GSPS"), m_frame->GetActSamplingSpeed());
m_stActFreq->SetLabel(wxstr);
if (m_osci->GetNumberOfBoards() == 0) {
m_cbTCalOn->SetValue(true);
m_cbTCalOn->Enable(true);
} else {
m_cbTCalOn->SetValue(m_frame->GetOsci()->IsTCalibrated());
m_cbTCalOn->Enable(m_frame->GetOsci()->IsTCalibrated());
}
}
void ConfigDialog::OnLock( wxCommandEvent& event )
{
m_frame->SetFreqLock(event.IsChecked());
}
void ConfigDialog::OnClose( wxCommandEvent& event )
{
this->Hide();
}
+61
View File
@@ -0,0 +1,61 @@
#ifndef __ConfigDialog__
#define __ConfigDialog__
// $Id: ConfigDialog.h 22325 2016-10-07 14:05:49Z ritt $
/**
@file
Subclass of ConfigDialog_fb, which is generated by wxFormBuilder.
*/
class DOFrame;
class Osci;
/** Implementing ConfigDialog_fb */
class ConfigDialog : public ConfigDialog_fb, DRSCallback
{
protected:
// Handlers for ConfigDialog_fb events.
void OnBoardSelect( wxCommandEvent& event );
void OnRescan( wxCommandEvent& event );
void OnInfo( wxCommandEvent& event );
void OnChannelHalf( wxCommandEvent& event );
void OnInputRange( wxCommandEvent& event );
void OnCalOn( wxCommandEvent& event );
void OnCalEnter( wxCommandEvent& event );
void OnCalSlider( wxScrollEvent& event );
void OnClkOn( wxCommandEvent& event );
void OnDateTime( wxCommandEvent& event );
void OnShowGrid( wxCommandEvent& event );
void OnDisplayWaveforms( wxCommandEvent& event );
void OnButtonCalVolt( wxCommandEvent& event );
void OnButtonSelect( wxCommandEvent& event );
void UpdateCalVolt(int value);
void OnButtonCalTime( wxCommandEvent& event );
void OnRemoveSpikes( wxCommandEvent& event );
void OnFreq( wxCommandEvent& event );
void OnLock( wxCommandEvent& event );
void OnClose( wxCommandEvent& event );
int fCalMode;
public:
/** Constructor */
ConfigDialog( wxWindow* parent );
void Progress(int prog);
void FreqChange();
void SelectBoard(int i);
private:
DOFrame *m_frame;
Osci *m_osci;
int m_board, m_firstChannel, m_chnSection;
void PopulateBoards(void);
void UpdateControls(void);
};
#endif // __ConfigDialog__
File diff suppressed because it is too large Load Diff
+231
View File
@@ -0,0 +1,231 @@
#ifndef __DOFrame__
#define __DOFrame__
// $Id: DOFrame.h 22327 2016-10-11 13:18:26Z ritt $
/**
@file
Subclass of DOFrame_fb, which is generated by wxFormBuilder.
*/
class EPThread;
/** Implementing DOFrame_fb */
class DOFrame : public DOFrame_fb
{
protected:
void LoadConfig(char *error, int size);
void SaveConfig(void);
// Handlers for DOFrame_fb events.
void OnConfig(wxCommandEvent& event);
void OnMeasure(wxCommandEvent& event);
void OnDisplay(wxCommandEvent& event);
void OnPrint(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnSave(wxCommandEvent& event);
void OnTrigger(wxCommandEvent& event);
void OnTrgButton(wxCommandEvent& event);
void OnTrgLevelChange(wxScrollEvent& event);
void OnTrgDelayChange(wxScrollEvent& event);
void OnChnOn(wxCommandEvent& event);
void OnPosChange(wxScrollEvent& event);
void OnScaleChange(wxCommandEvent& event);
void OnHScaleChange(wxCommandEvent& event);
void OnHOffsetChange(wxScrollEvent& event);
void OnZero(wxMouseEvent& event);
void OnTimer(wxTimerEvent& event);
void OnCursor(wxCommandEvent& event);
void OnSnap(wxCommandEvent& event);
void ProcessEvents(void);
public:
DOFrame( wxWindow* parent );
~DOFrame();
ConfigDialog *GetConfigDialog() { return m_configDialog; }
wxColor GetColor(int i, bool p) { return p ? m_pcolor[i]: m_color[i]; }
int GetAcqPerSecond() { return m_acqPerSecond; }
double GetTrgLevel(int i) { return m_trgLevel[m_board][i]; }
bool IsTrgConfigEnabled() { return m_trgConfigEnabled[m_board]; }
int GetTrgMode() { return m_trgMode[m_board]; }
int GetTrgSource(int b) { return m_trgSource[b]; }
int GetTrgPolarity() { return m_trgNegative[m_board]; }
double GetTrgDelay() { return m_trgDelayNs[m_board]; }
int GetTriggerConfig() { return m_trgConfig[m_board]; }
double GetTrgPosition(int board);
time_t GetLastTriggerUpdate() { return m_lastTriggerUpdate; }
bool IsIdle();
bool GetRearm() { return m_rearm; }
bool GetTrgCorr() { return m_trgCorr; }
MXML_WRITER *GetWFFile() { return m_WFFile; }
int GetWFfd() { return m_WFfd; }
int GetNSaved() { return m_nSaved; }
int GetNSaveMax() { return m_nSaveMax; }
void SetRearm(bool f) { m_rearm = f; }
void SetSamplingSpeed(double speed);
double GetReqSamplingSpeed() { return m_reqSamplingSpeed; }
double GetActSamplingSpeed();
void SetTrgLevel(int i, double value);
Osci *GetOsci() { return m_osci; }
void SetPaintMode(int pm) { m_screen->SetPaintMode(pm); }
void SetDisplayDateTime(bool flag);
void SetDisplayShowGrid(bool flag);
void SetDisplayLines(bool flag);
void SetDisplayMode(int mode, int n);
void SetDisplayScalers(bool flag);
void SetDisplayCalibrated(bool flag);
void SetDisplayCalibrated2(bool flag);
void SetDisplayTCalOn(bool flag);
void SetDisplayTrgCorr(bool flag);
void SetDisplayRotated(bool flag);
void SetCursorA(bool flag);
void SetCursorB(bool flag);
bool IsCursorA() { return m_cursorA; }
bool IsCursorB() { return m_cursorB; }
int ActiveCursor() { return m_actCursor; }
void SetActiveCursor(int c) { m_actCursor = c; }
bool IsSnap() { return m_snap; }
void ToggleControls();
void SetMeasurement(int id, bool flag);
void SetMathDisplay(int id, bool flag);
void SetTriggerConfig(int id, bool flag);
void SetTriggerSource(int b, int source);
void SetTriggerPolarity(int b, bool negative);
void SetStat(bool flag);
void SetHist(bool flag);
void SetStatNStat(int n);
int GetNStat() { return m_nStat; }
void SetIndicator(bool flag);
void SetClkOn(bool flag){ m_clkOn = flag; m_osci->SetClkOn(flag) ; }
bool GetClkOn() { return m_clkOn; }
void SelectBoard(int board);
int GetCurrentBoard() { return m_board; }
void SetMultiBoard(bool flag);
void SetSplitMode(bool flag) { m_splitMode = flag; m_screen->SetSplitMode(flag); }
bool GetMultiBoard() { return m_multiBoard; }
void SetSource(int board, int firstChannel, int chnSection);
void SetRefclk(int board, bool flag);
bool GetRefclk() { return m_refClk > 0; }
void SetRange(double range){ m_range[m_board] = range; }
double GetRange() { return m_range[m_board]; }
void SetSpikeRemoval(bool flag) { m_spikeRemoval = flag; m_osci->SetSpikeRemoval(flag); }
bool GetSpikeRemovel() { return m_spikeRemoval; }
void StatReset();
bool IsStat() { return m_stat; }
bool IsHist() { return m_hist; }
bool IsIndicator() { return m_indicator; }
wxTimer *GetTimer() { return m_timer; }
void UpdateStatusBar();
bool IsFirst() { return m_first; }
void SetFreqLock(bool flag) { m_freqLocked = flag; }
bool IsFreqLocked() { return m_freqLocked; }
void SetProgress(int prog) { m_progress = prog; }
int GetProgress() { return m_progress; }
void UpdateWaveforms();
void ClearWaveforms();
void UpdateControls();
float *GetWaveform(int b, int c);
float *GetTime(int b, int c);
void EnableTriggerConfig(bool flag);
bool IsMeasurement(int m, int chn);
double GetMeasurement(int idx, double *x, double *y, int n);
wxString GetMeasurementName(int idx) { return m_measurement[idx][0]->GetName(); }
Measurement* GetMeasurement(int idx, int chn);
void EvaluateMeasurements(void);
void ChangeHScale(int delta);
void RecalculateHOffset(double trgFrac);
void CloseWFFile(bool errorFlag);
void SetSaveBtn(wxString l, wxString t);
void IncrementAcquisitions();
void IncrementSaved();
void EnableEPThread(bool flag);
void SaveHisto();
private:
DECLARE_EVENT_TABLE()
DOScreen *m_screen;
Osci *m_osci;
Measurement *m_measurement[Measurement::N_MEASUREMENTS][4];
bool m_measFlag[Measurement::N_MEASUREMENTS][4];
bool m_stat;
bool m_hist;
bool m_indicator;
bool m_first;
wxTimer *m_timer;
ConfigDialog *m_configDialog;
MeasureDialog *m_measureDialog;
TriggerDialog *m_triggerDialog;
DisplayDialog *m_displayDialog;
EPThread *m_epthread;
float m_time[MAX_N_BOARDS][4][2048];
float m_waveform[MAX_N_BOARDS][4][2048];
char m_xmlError[256];
bool m_running;
bool m_single;
bool m_rearm;
double m_reqSamplingSpeed;
bool m_freqLocked;
bool m_oldIdle;
double m_trgLevel[MAX_N_BOARDS][4];
int m_trgMode[MAX_N_BOARDS];
bool m_trgNegative[MAX_N_BOARDS];
int m_trgSource[MAX_N_BOARDS];
int m_trgDelay[MAX_N_BOARDS];
double m_trgDelayNs[MAX_N_BOARDS];
int m_trgConfig[MAX_N_BOARDS];
bool m_trgConfigEnabled[MAX_N_BOARDS];
bool m_refClk[MAX_N_BOARDS];
bool m_trgCorr;
int m_HScale[MAX_N_BOARDS];
int m_HOffset[MAX_N_BOARDS];
bool m_chnOn[MAX_N_BOARDS][4];
int m_chnOffset[MAX_N_BOARDS][4];
int m_chnScale[MAX_N_BOARDS][4];
bool m_clkOn;
double m_range[MAX_N_BOARDS];
bool m_spikeRemoval;
bool m_displayScalers;
wxColour m_color[5];
wxColour m_pcolor[5];
int m_acquisitions;
wxStopWatch m_stopWatch;
wxStopWatch m_stopWatch1;
int m_acqPerSecond;
int m_nStat;
time_t m_lastTriggerUpdate;
MXML_WRITER *m_WFFile;
int m_WFfd;
int m_nSaved;
int m_nSaveMax;
int m_actCursor;
bool m_cursorA;
bool m_cursorB;
bool m_snap;
bool m_hideControls;
int m_board;
int m_firstChannel;
int m_chnSection;
bool m_multiBoard;
bool m_splitMode;
int m_progress;
};
#endif // __DOFrame__
File diff suppressed because it is too large Load Diff
+169
View File
@@ -0,0 +1,169 @@
/*
* DOScreen.h
* DRS oscilloscope screen header file
* $Id: DOScreen.h 22327 2016-10-11 13:18:26Z ritt $
*/
class Osci;
class DOFrame;
enum PaintModes {
kPMWaveform,
kPMTimeCalibration,
};
class DOScreen : public wxWindow
{
public:
DOScreen(wxWindow* parent, Osci *osci, DOFrame *frame);
~DOScreen();
void SelectBoard(int b) { m_board = b; }
void SetChnOn(int b, int i, int value ) { m_chnon[b][i] = value; }
int GetChnOn(int b, int i) { return m_chnon[b][i]; }
int GetCurChn() { return m_chn; }
bool GetSplitMode() { return m_splitMode; }
void SetSplitMode(bool flag) { m_splitMode = flag; }
void SetPaintMode(int pm) { m_paintMode = pm; }
void SetPos(int b, int i, double value) { m_offset[b][i] = value; }
void SetScale(int b, int i, int sclae);
void SetHScale(int b, int hscale);
void SetHScaleInc(int b, int increment);
int GetPaintMode() { return m_paintMode; }
void SetScreenOffset(int b, int offset) { m_screenOffset[b] = offset; }
int GetScreenSize(int b) { return m_screenSize[b]; }
int GetScreenOffset(int b) { return m_screenOffset[b]; }
int GetScaleIndex(int b, int i) { return m_scale[b][i]; }
double GetScale(int b, int i) { return m_scaleTable[m_scale[b][i]]; }
double GetOffset(int b, int i) { return m_offset[b][i]; }
int GetHScale(int b) { return m_hscale[b]; }
void SetDisplayDateTime(bool flag) { m_displayDateTime = flag; }
void SetDisplayShowGrid(bool flag) { m_displayShowGrid = flag; }
void SetDisplayLines(bool flag) { m_displayLines = flag; }
void SetDisplayScalers(bool flag) { m_displayScalers = flag; }
void SetDisplayMode(int mode, int n) { m_displayMode = mode; m_displayN = n; }
void SetMathDisplay(int id, bool flag);
wxDC *GetDC() { return m_dc; }
int GetX1() { return m_x1[m_board]; }
int GetX2() { return m_x2[m_board]; }
int GetY1() { return m_y1[m_board]; }
int GetY2() { return m_y2[m_board]; }
int timeToX(float t);
int voltToY(float v);
int voltToY(int chn, float v);
double XToTime(int x);
double YToVolt(int y);
double YToVolt(int chn, int y);
double GetT1();
double GetT2();
static const int m_scaleTable[10];
static const int m_hscaleTable[13];
// event handlers
void OnPaint(wxPaintEvent& event);
void OnSize(wxSizeEvent& event);
// drawing routines
void DrawScope(wxDC& dc, wxCoord w, wxCoord h, bool printing);
void DrawScopeBottom(wxDC& dc, int board, int x1, int y1, int width, bool printing);
void DrawWaveforms(wxDC& dc, int wfIndex, bool printing);
void DrawHisto(wxDC& dc, wxCoord w, wxCoord h, bool printing);
void SaveHisto(int fd);
void DrawTcalib(wxDC& dc, wxCoord w, wxCoord h, bool printing);
void DrawMath(wxDC& dc, wxCoord width, wxCoord height, bool printing);
void DrawPeriodJitter(wxDC& dc, int chn, bool printing);
void DrawHAxis(wxDC &dc, int x1, int y1, int width,
int minor, int major, int text, int label, int grid, double xmin, double xmax);
void OnMouse(wxMouseEvent& event);
private:
// any class wishing to process wxWidgets events must use this macro
DECLARE_EVENT_TABLE()
// pointer for main Osci object
Osci *m_osci;
// pointer to DOFrame object
DOFrame *m_frame;
// fonts
wxFont m_fontNormal;
wxFont m_fontFixed;
wxFont m_fontFixedBold;
// coordinates of total scope area
int m_sx1, m_sx2, m_sy1, m_sy2;
// coordinates of subpanel area
int m_x1[MAX_N_BOARDS], m_x2[MAX_N_BOARDS], m_y1[MAX_N_BOARDS], m_y2[MAX_N_BOARDS];
// split mode
bool m_splitMode;
// current device context
wxDC *m_dc;
// stop watch for screen updates
wxStopWatch m_sw;
// paing mode
int m_paintMode;
// current board index for drawing
int m_board;
// curent channel index
int m_chn;
// offset and size of display area in ns
int m_screenSize[MAX_N_BOARDS], m_screenOffset[MAX_N_BOARDS];
// cursor variables
int m_clientHeight, m_clientWidth;
double m_mouseX;
double m_mouseY;
int m_MeasX1, m_MeasX2, m_MeasY1, m_MeasY2;
int m_BSX1[MAX_N_BOARDS], m_BSX2[MAX_N_BOARDS], m_BSY1[MAX_N_BOARDS], m_BSY2[MAX_N_BOARDS];
double m_xCursorA, m_xCursorB, m_yCursorA, m_yCursorB;
int m_idxA, m_idxB;
double m_uCursorA, m_uCursorB, m_tCursorA, m_tCursorB;
// waveform propoerties
int m_chnon[MAX_N_BOARDS][4];
double m_offset[MAX_N_BOARDS][4];
int m_scale[MAX_N_BOARDS][4];
int m_hscale[MAX_N_BOARDS];
// math display
bool m_mathFlag[2][4];
// histogram coordinates
int m_hx1, m_hy1, m_hx2, m_hy2;
// save button
int m_savex1, m_savey1, m_savex2, m_savey2;
// histogram x axis
bool m_histAxisAuto;
double m_histAxisMin;
double m_histAxisMax;
double m_minCursor;
double m_maxCursor;
bool m_dragMin, m_dragMax;
// display properties
bool m_displayDateTime, m_displayShowGrid, m_displayLines, m_displayScalers;
int m_displayMode, m_displayN;
// grid drawing (screen vs. printer)
void DrawDot(wxDC& dc, wxCoord w, wxCoord h, bool printing);
// find waveform point close to mouse cursor
bool FindClosestWafeformPoint(int& idx_min, int& x_min, int& y_min);
// optional debug message
char m_debugMsg[80];
};
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
+604
View File
@@ -0,0 +1,604 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 27 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DRSOSC_H__
#define __DRSOSC_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/panel.h>
#include <wx/slider.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/radiobut.h>
#include <wx/bmpbuttn.h>
#include <wx/statbox.h>
#include <wx/stattext.h>
#include <wx/radiobox.h>
#include <wx/tglbtn.h>
#include <wx/checkbox.h>
#include <wx/frame.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/gauge.h>
#include <wx/dialog.h>
#include <wx/combobox.h>
#include <wx/statline.h>
#include <wx/statbmp.h>
#include <wx/hyperlink.h>
///////////////////////////////////////////////////////////////////////////
#define ID_CURSORA 1000
#define ID_CURSORB 1001
#define ID_TR_LEVEL 1002
#define ID_RUN 1003
#define ID_SINGLE 1004
#define ID_TR_NORMAL 1005
#define ID_TR_AUTO 1006
#define ID_TR_POLARITY 1007
#define ID_TRGCFG 1008
#define ID_TR_DELAY 1009
#define ID_TR_SOURCE 1010
#define ID_HSCALEDOWN 1011
#define ID_HSCALEUP 1012
#define ID_HOR_POS 1013
#define ID_CHON1 1014
#define ID_POS1 1015
#define ID_SCALEUP1 1016
#define ID_SCALEDN1 1017
#define ID_CHON2 1018
#define ID_POS2 1019
#define ID_SCALEUP2 1020
#define ID_SCALEDN2 1021
#define ID_CHON3 1022
#define ID_POS3 1023
#define ID_SCALEUP3 1024
#define ID_SCALEDN3 1025
#define ID_CHON4 1026
#define ID_POS4 1027
#define ID_SCALEUP4 1028
#define ID_SCALEDN4 1029
#define ID_CONFIG 1030
#define ID_SAVE 1031
#define ID_MEASURE 1032
#define ID_PRINT 1033
#define ID_ABOUT 1034
#define ID_EXIT 1035
#define ID_BSEL 1036
#define ID_MULTI 1037
#define ID_CH_HALF 1038
#define ID_DISP_CALIBRATED 1039
#define ID_DISP_CALIBRATED2 1040
#define ID_DISP_ROTATED 1041
#define ID_DISP_TCALIBRATED 1042
#define ID_DISP_TRGCORR 1043
#define ID_REFCLK 1044
#define ID_DISPSAMPLE 1045
#define ID_DISPAVERAGE 1046
#define ID_DISPPERSIST 1047
#define ID_DISPNUMBER 1048
#define ID_PJ1 1049
#define ID_PJ2 1050
#define ID_PJ3 1051
#define ID_PJ4 1052
#define ID_LEVEL1 1053
#define ID_LEVEL2 1054
#define ID_LEVEL3 1055
#define ID_LEVEL4 1056
#define ID_PKPK1 1057
#define ID_PKPK2 1058
#define ID_PKPK3 1059
#define ID_PKPK4 1060
#define ID_RMS1 1061
#define ID_RMS2 1062
#define ID_RMS3 1063
#define ID_RMS4 1064
#define ID_VS1 1065
#define ID_VS2 1066
#define ID_VS3 1067
#define ID_VS4 1068
#define ID_CHRG1 1069
#define ID_CHRG2 1070
#define ID_CHRG3 1071
#define ID_CHRG4 1072
#define ID_FREQ1 1073
#define ID_FREQ2 1074
#define ID_FREQ3 1075
#define ID_FREQ4 1076
#define ID_PERIOD1 1077
#define ID_PERIOD2 1078
#define ID_PERIOD3 1079
#define ID_PERIOD4 1080
#define ID_RISE1 1081
#define ID_RISE2 1082
#define ID_RISE3 1083
#define ID_RISE4 1084
#define ID_FALL1 1085
#define ID_FALL2 1086
#define ID_FALL3 1087
#define ID_FALL4 1088
#define ID_POSWIDTH1 1089
#define ID_POSWIDTH2 1090
#define ID_POSWIDTH3 1091
#define ID_POSWIDTH4 1092
#define ID_NEGWIDTH1 1093
#define ID_NEGWIDTH2 1094
#define ID_NEGWIDTH3 1095
#define ID_NEGWIDTH4 1096
#define ID_CHNDELAY1 1097
#define ID_CHNDELAY2 1098
#define ID_CHNDELAY3 1099
#define ID_CHNDELAY4 1100
#define ID_HS1 1101
#define ID_HS2 1102
#define ID_HS3 1103
#define ID_HS4 1104
#define ID_OR1 1105
#define ID_OR2 1106
#define ID_OR3 1107
#define ID_OR4 1108
#define ID_OREXT 1109
#define ID_AND1 1110
#define ID_AND2 1111
#define ID_AND3 1112
#define ID_AND4 1113
#define ID_ANDEXT 1114
#define ID_TRANS 1115
///////////////////////////////////////////////////////////////////////////////
/// Class DOFrame_fb
///////////////////////////////////////////////////////////////////////////////
class DOFrame_fb : public wxFrame
{
private:
protected:
wxMenuBar* m_menubar1;
wxMenu* m_menu1;
wxMenu* m_menu4;
wxMenu* m_menu3;
wxMenu* m_menu2;
wxPanel* m_pnScreen;
wxPanel* m_pnControls;
wxSlider* m_slTrgLevel;
wxButton* m_btRun;
wxButton* m_btSingle;
wxRadioButton* m_rbNormal;
wxRadioButton* m_rbAuto;
wxBitmapButton* m_bpPolarity;
wxButton* m_btTrgCfg;
wxStaticText* m_staticText59;
wxStaticText* m_staticText60;
wxStaticText* m_staticText61;
wxSlider* m_slTrgDelay;
wxRadioBox* m_rbSource;
wxBitmapButton* m_bpButton2;
wxStaticText* m_stHScale;
wxBitmapButton* m_bpButton3;
wxSlider* m_slHOffset;
wxToggleButton* m_btCh1;
wxSlider* m_slPos1;
wxBitmapButton* m_bpButton4;
wxStaticText* m_stScale1;
wxBitmapButton* m_bpButton5;
wxToggleButton* m_btCh2;
wxSlider* m_slPos2;
wxBitmapButton* m_bpButton6;
wxStaticText* m_stScale2;
wxBitmapButton* m_bpButton7;
wxToggleButton* m_btCh3;
wxSlider* m_slPos3;
wxBitmapButton* m_bpButton8;
wxStaticText* m_stScale3;
wxBitmapButton* m_bpButton9;
wxToggleButton* m_btCh4;
wxSlider* m_slPos4;
wxBitmapButton* m_bpButton10;
wxStaticText* m_stScale4;
wxBitmapButton* m_bpButton11;
wxStaticText* m_staticText76;
wxToggleButton* m_toggleCursorA;
wxToggleButton* m_toggleCursorB;
wxCheckBox* m_checkBox8;
wxButton* m_btConfig;
wxButton* m_btSave;
wxButton* m_btMeasure;
wxButton* m_btDisplay;
wxButton* m_btPrint;
wxButton* m_btAbout;
wxButton* m_btExit;
// Virtual event handlers, overide them in your derived class
virtual void OnSave( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPrint( wxCommandEvent& event ) { event.Skip(); }
virtual void OnExit( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCursor( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSnap( wxCommandEvent& event ) { event.Skip(); }
virtual void OnConfig( wxCommandEvent& event ) { event.Skip(); }
virtual void OnMeasure( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDisplay( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAbout( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTrgLevelChange( wxScrollEvent& event ) { event.Skip(); }
virtual void OnZero( wxMouseEvent& event ) { event.Skip(); }
virtual void OnTrigger( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTrgButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTrgDelayChange( wxScrollEvent& event ) { event.Skip(); }
virtual void OnHScaleChange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnHOffsetChange( wxScrollEvent& event ) { event.Skip(); }
virtual void OnChnOn( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPosChange( wxScrollEvent& event ) { event.Skip(); }
virtual void OnScaleChange( wxCommandEvent& event ) { event.Skip(); }
public:
DOFrame_fb( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("DRS Oscilloscope"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 1024,768 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
~DOFrame_fb();
};
///////////////////////////////////////////////////////////////////////////////
/// Class ConfigDialog_fb
///////////////////////////////////////////////////////////////////////////////
class ConfigDialog_fb : public wxDialog
{
private:
protected:
wxChoice* m_cbBoard;
wxButton* m_btScan;
wxButton* m_btInfo;
wxCheckBox* m_cbMulti;
wxRadioBox* m_rbChHalf;
wxCheckBox* m_cbClkOn;
wxRadioBox* m_rbRange;
wxTextCtrl* m_tbFreq;
wxStaticText* m_staticText26;
wxCheckBox* m_cbLocked;
wxStaticText* m_staticText261;
wxStaticText* m_stActFreq;
wxCheckBox* m_cbCalOn;
wxTextCtrl* m_teCal;
wxSlider* m_slCal;
wxStaticText* m_staticText10;
wxCheckBox* m_cbCalibrated;
wxCheckBox* m_cbCalibrated2;
wxCheckBox* m_cbSpikes;
wxButton* m_button13;
wxGauge* m_gaugeCalVolt;
wxCheckBox* m_cbRotated;
wxCheckBox* m_cbTCalOn;
wxCheckBox* m_cbTrgCorr;
wxCheckBox* m_cbExtRefclk;
wxButton* m_button14;
wxGauge* m_gaugeCalTime;
wxButton* m_button10;
// Virtual event handlers, overide them in your derived class
virtual void OnBoardSelect( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRescan( wxCommandEvent& event ) { event.Skip(); }
virtual void OnInfo( wxCommandEvent& event ) { event.Skip(); }
virtual void OnChannelHalf( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClkOn( wxCommandEvent& event ) { event.Skip(); }
virtual void OnInputRange( wxCommandEvent& event ) { event.Skip(); }
virtual void OnFreq( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLock( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCalOn( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCalEnter( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCalSlider( wxScrollEvent& event ) { event.Skip(); }
virtual void OnDisplayWaveforms( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveSpikes( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCalVolt( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonCalTime( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
ConfigDialog_fb( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~ConfigDialog_fb();
};
///////////////////////////////////////////////////////////////////////////////
/// Class DisplayDialog_fb
///////////////////////////////////////////////////////////////////////////////
class DisplayDialog_fb : public wxDialog
{
private:
protected:
wxCheckBox* m_checkBox7;
wxCheckBox* m_checkBox71;
wxCheckBox* m_checkBox88;
wxCheckBox* m_checkBox73;
wxRadioButton* m_rbShowSample;
wxRadioButton* m_rbShowAverage;
wxRadioButton* m_rbShowPersist;
wxStaticText* m_staticText59;
wxComboBox* m_cbNumber;
wxStaticText* m_staticText11;
wxStaticText* m_staticText12;
wxStaticText* m_staticText13;
wxStaticText* m_staticText14;
wxStaticText* m_staticText15;
wxStaticText* m_staticText17;
wxCheckBox* m_checkBox13;
wxCheckBox* m_checkBox14;
wxCheckBox* m_checkBox15;
wxCheckBox* m_checkBox16;
wxButton* m_button10;
// Virtual event handlers, overide them in your derived class
virtual void OnDateTime( wxCommandEvent& event ) { event.Skip(); }
virtual void OnShowGrid( wxCommandEvent& event ) { event.Skip(); }
virtual void OnLines( wxCommandEvent& event ) { event.Skip(); }
virtual void OnScalers( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDisplayMode( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
DisplayDialog_fb( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Display"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~DisplayDialog_fb();
};
///////////////////////////////////////////////////////////////////////////////
/// Class MeasureDialog_fb
///////////////////////////////////////////////////////////////////////////////
class MeasureDialog_fb : public wxDialog
{
private:
protected:
wxStaticText* m_staticText11;
wxStaticText* m_staticText12;
wxStaticText* m_staticText13;
wxStaticText* m_staticText14;
wxStaticText* m_staticText15;
wxStaticText* m_staticText80;
wxStaticText* m_staticText81;
wxStaticText* m_staticText82;
wxStaticText* m_staticText83;
wxStaticText* m_staticText84;
wxStaticText* m_staticText16;
wxCheckBox* m_checkBox9;
wxCheckBox* m_checkBox10;
wxCheckBox* m_checkBox11;
wxCheckBox* m_checkBox12;
wxStaticText* m_staticText17;
wxCheckBox* m_checkBox13;
wxCheckBox* m_checkBox14;
wxCheckBox* m_checkBox15;
wxCheckBox* m_checkBox16;
wxStaticText* m_staticText19;
wxCheckBox* m_checkBox17;
wxCheckBox* m_checkBox18;
wxCheckBox* m_checkBox19;
wxCheckBox* m_checkBox20;
wxStaticText* m_staticText90;
wxCheckBox* m_checkBox74;
wxCheckBox* m_checkBox75;
wxCheckBox* m_checkBox76;
wxCheckBox* m_checkBox77;
wxStaticText* m_staticText91;
wxCheckBox* m_checkBox82;
wxCheckBox* m_checkBox83;
wxCheckBox* m_checkBox84;
wxCheckBox* m_checkBox85;
wxStaticLine* m_staticline4;
wxStaticLine* m_staticline41;
wxStaticLine* m_staticline42;
wxStaticLine* m_staticline43;
wxStaticLine* m_staticline44;
wxStaticText* m_staticText85;
wxStaticText* m_staticText86;
wxStaticText* m_staticText87;
wxStaticText* m_staticText88;
wxStaticText* m_staticText89;
wxStaticText* m_staticText20;
wxCheckBox* m_checkBox21;
wxCheckBox* m_checkBox22;
wxCheckBox* m_checkBox23;
wxCheckBox* m_checkBox24;
wxStaticText* m_staticText21;
wxCheckBox* m_checkBox25;
wxCheckBox* m_checkBox26;
wxCheckBox* m_checkBox27;
wxCheckBox* m_checkBox28;
wxStaticText* m_staticText22;
wxCheckBox* m_checkBox29;
wxCheckBox* m_checkBox30;
wxCheckBox* m_checkBox31;
wxCheckBox* m_checkBox32;
wxStaticText* m_staticText23;
wxCheckBox* m_checkBox33;
wxCheckBox* m_checkBox34;
wxCheckBox* m_checkBox35;
wxCheckBox* m_checkBox36;
wxStaticText* m_staticText221;
wxCheckBox* m_checkBox291;
wxCheckBox* m_checkBox2911;
wxCheckBox* m_checkBox2912;
wxCheckBox* m_checkBox2913;
wxStaticText* m_staticText2211;
wxCheckBox* m_checkBox2914;
wxCheckBox* m_checkBox2915;
wxCheckBox* m_checkBox2916;
wxCheckBox* m_checkBox2917;
wxStaticText* m_staticText231;
wxCheckBox* m_checkBox37;
wxCheckBox* m_checkBox38;
wxCheckBox* m_checkBox39;
wxCheckBox* m_checkBox40;
wxStaticText* m_staticText901;
wxCheckBox* m_checkBox78;
wxCheckBox* m_checkBox79;
wxCheckBox* m_checkBox80;
wxCheckBox* m_checkBox81;
wxStaticLine* m_staticline1;
wxCheckBox* m_cbStat;
wxCheckBox* m_cbHist;
wxStaticText* m_staticText27;
wxComboBox* m_cbNAverage;
wxStaticText* m_staticText271;
wxButton* m_button15;
wxStaticLine* m_staticline2;
wxCheckBox* m_cbIndicator;
wxStaticLine* m_staticline21;
wxButton* m_button11;
// Virtual event handlers, overide them in your derived class
virtual void OnButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnStat( wxCommandEvent& event ) { event.Skip(); }
virtual void OnHist( wxCommandEvent& event ) { event.Skip(); }
virtual void OnStatNAverage( wxCommandEvent& event ) { event.Skip(); }
virtual void OnStatReset( wxCommandEvent& event ) { event.Skip(); }
virtual void OnIndicator( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
MeasureDialog_fb( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Select Measurements"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~MeasureDialog_fb();
};
///////////////////////////////////////////////////////////////////////////////
/// Class TriggerDialog_fb
///////////////////////////////////////////////////////////////////////////////
class TriggerDialog_fb : public wxDialog
{
private:
protected:
wxStaticText* m_staticText12;
wxStaticText* m_staticText13;
wxStaticText* m_staticText14;
wxStaticText* m_staticText15;
wxStaticText* m_staticText16;
wxStaticLine* m_staticline11;
wxStaticText* m_staticText771;
wxCheckBox* m_cbOR1;
wxStaticText* m_staticText17;
wxCheckBox* m_cbOR2;
wxStaticText* m_staticText171;
wxCheckBox* m_cbOR3;
wxStaticText* m_staticText172;
wxCheckBox* m_cbOR4;
wxStaticText* m_staticText173;
wxCheckBox* m_cbOREXT;
wxStaticText* m_staticText84;
wxCheckBox* m_cbAND1;
wxStaticText* m_staticText18;
wxCheckBox* m_cbAND2;
wxStaticText* m_staticText181;
wxCheckBox* m_cbAND3;
wxStaticText* m_staticText182;
wxCheckBox* m_cbAND4;
wxStaticText* m_staticText183;
wxCheckBox* m_cbANDEXT;
wxCheckBox* m_cbTrans;
wxStaticLine* m_staticline10;
wxStaticText* m_staticText77;
wxTextCtrl* m_tbLevel1;
wxTextCtrl* m_tbLevel2;
wxTextCtrl* m_tbLevel3;
wxTextCtrl* m_tbLevel4;
wxStaticText* m_staticText78;
wxStaticLine* m_staticline25;
wxButton* m_button11;
// Virtual event handlers, overide them in your derived class
virtual void OnButton( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTriggerLevel( wxCommandEvent& event ) { event.Skip(); }
virtual void OnClose( wxCommandEvent& event ) { event.Skip(); }
public:
TriggerDialog_fb( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Configure Trigger"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
~TriggerDialog_fb();
};
///////////////////////////////////////////////////////////////////////////////
/// Class AboutDialog_fb
///////////////////////////////////////////////////////////////////////////////
class AboutDialog_fb : public wxDialog
{
private:
protected:
wxStaticText* m_staticText18;
wxStaticText* m_stVersion;
wxStaticText* m_stBuild;
wxStaticText* m_staticText20;
wxStaticText* m_staticText21;
wxStaticBitmap* m_bitmap1;
wxStaticText* m_staticText23;
wxHyperlinkCtrl* m_hyperlink1;
wxButton* m_button12;
public:
AboutDialog_fb( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~AboutDialog_fb();
};
///////////////////////////////////////////////////////////////////////////////
/// Class InfoDialog_fb
///////////////////////////////////////////////////////////////////////////////
class InfoDialog_fb : public wxDialog
{
private:
protected:
wxStaticText* m_staticText45;
wxStaticText* m_stBoardType;
wxStaticText* m_staticText47;
wxStaticText* m_stDRSType;
wxStaticText* m_staticText49;
wxStaticText* m_stSerialNumber;
wxStaticText* m_staticText51;
wxStaticText* m_stFirmwareRevision;
wxStaticText* m_staticText53;
wxStaticText* m_stTemperature;
wxStaticText* m_staticText55;
wxStaticText* m_stInputRange;
wxStaticText* m_staticText57;
wxStaticText* m_stCalibratedRange;
wxStaticText* m_staticText59;
wxStaticText* m_stCalibratedFrequency;
wxStaticText* m_staticText61;
wxStaticText* m_stFrequency;
wxButton* m_button12;
public:
InfoDialog_fb( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Info"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~InfoDialog_fb();
};
#endif //__DRSOSC_H__
Binary file not shown.
+33
View File
@@ -0,0 +1,33 @@
/*
* DRSOscInc.h
* Collection of all DRS oscilloscope header include files
* $Id: DRSOscInc.h 20924 2013-03-21 13:31:33Z ritt $
*/
#define MAX_N_BOARDS 16
#include "wx/wx.h"
#include "wx/dcbuffer.h"
#include "wx/print.h"
#include "wx/numdlg.h"
#include "mxml.h"
#include "DRS.h"
#include "DRSOsc.h"
#include "Osci.h"
#include "Measurement.h"
#include "ConfigDialog.h"
#include "DisplayDialog.h"
#include "AboutDialog.h"
#include "InfoDialog.h"
#include "MeasureDialog.h"
#include "TriggerDialog.h"
#include "DOScreen.h"
#include "DOFrame.h"
#include "EPThread.h"
double ss_nan();
int ss_isnan(double x);
void ss_sleep(int ms);
+60
View File
@@ -0,0 +1,60 @@
/*
* DisplayDialog.cpp
* Modeless Displayuration Dialog class
* $Id: DisplayDialog.cpp 21252 2014-02-06 09:37:27Z ritt $
*/
#include "DRSOscInc.h"
DisplayDialog::DisplayDialog( wxWindow* parent )
:
DisplayDialog_fb( parent )
{
m_frame = (DOFrame *)parent;
m_osci = m_frame->GetOsci();
}
void DisplayDialog::OnDateTime( wxCommandEvent& event )
{
m_frame->SetDisplayDateTime(event.IsChecked());
}
void DisplayDialog::OnShowGrid( wxCommandEvent& event )
{
m_frame->SetDisplayShowGrid(event.IsChecked());
}
void DisplayDialog::OnLines( wxCommandEvent& event )
{
m_frame->SetDisplayLines(event.IsChecked());
}
void DisplayDialog::OnDisplayMode( wxCommandEvent& event )
{
long n;
m_cbNumber->GetValue().ToLong(&n);
if (event.GetId() == ID_DISPSAMPLE)
m_frame->SetDisplayMode(ID_DISPSAMPLE, 0);
else if (event.GetId() == ID_DISPAVERAGE)
m_frame->SetDisplayMode(ID_DISPAVERAGE, n);
else if (event.GetId() == ID_DISPPERSIST)
m_frame->SetDisplayMode(ID_DISPPERSIST, n);
else if (event.GetId() == ID_DISPNUMBER)
m_frame->SetDisplayMode(m_rbShowAverage->GetValue()?ID_DISPAVERAGE:ID_DISPPERSIST, n);
}
void DisplayDialog::OnScalers( wxCommandEvent& event )
{
m_frame->SetDisplayScalers(event.IsChecked());
}
void DisplayDialog::OnButton( wxCommandEvent& event )
{
m_frame->SetMathDisplay(event.GetId(), event.IsChecked());
}
void DisplayDialog::OnClose( wxCommandEvent& event )
{
this->Hide();
}
+41
View File
@@ -0,0 +1,41 @@
#ifndef __DisplayDialog__
#define __DisplayDialog__
// $Id: DisplayDialog.h 21252 2014-02-06 09:37:27Z ritt $
/**
@file
Subclass of DisplayDialog_fb, which is generated by wxFormBuilder.
*/
class DOFrame;
class Osci;
/** Implementing DisplayDialog_fb */
class DisplayDialog : public DisplayDialog_fb
{
protected:
// Handlers for DisplayDialog_fb events.
void OnDateTime(wxCommandEvent& event);
void OnShowGrid(wxCommandEvent& event);
void OnLines(wxCommandEvent& event);
void OnDisplayMode(wxCommandEvent& event);
void OnButton(wxCommandEvent& event);
void OnScalers(wxCommandEvent& event);
void OnClose(wxCommandEvent& event);
public:
/** Constructor */
DisplayDialog( wxWindow* parent );
private:
DOFrame *m_frame;
Osci *m_osci;
void PopulateBoards(void);
void EnableButtons(void);
};
#endif // __DisplayDialog__
+124
View File
@@ -0,0 +1,124 @@
/*
* EPThread.cpp
* DRS oscilloscope event processing thread
* $Id: EPThread.cpp 21511 2014-10-17 08:02:30Z ritt $
*/
#include "DRSOscInc.h"
#include "rb.h"
extern wxCriticalSection *g_epcs;
bool g_finished = false;
/*------------------------------------------------------------------*/
EPThread::EPThread(DOFrame *f) : wxThread()
{
m_frame = f;
m_osci = f->GetOsci();
m_finished = false;
m_stopThread = false;
m_active = false;
m_enabled = true;
Create();
Run();
}
/*------------------------------------------------------------------*/
EPThread::~EPThread()
{
}
/*------------------------------------------------------------------*/
void EPThread::ClearWaveforms()
{
while (m_osci->HasNewEvent());
memset(m_time, 0, sizeof(m_time));
memset(m_waveform, 0, sizeof(m_waveform));
}
/*------------------------------------------------------------------*/
void EPThread::StopThread()
{
m_stopThread = true;
do {
wxThread::Sleep(10);
} while (!g_finished); // cannot access m_finished here under Widnows
}
/*------------------------------------------------------------------*/
void EPThread::Enable(bool flag)
{
m_enabled = flag;
if (!flag)
while (m_active)
wxThread::Sleep(10);
}
/*------------------------------------------------------------------*/
void *EPThread::Entry()
{
int status;
do {
if (m_enabled) {
m_active = true;
if (m_osci->HasNewEvent()) {
m_osci->ReadWaveforms();
if (m_frame->GetRearm()) {
m_osci->Start();
m_frame->SetRearm(false);
}
if (m_frame->GetTrgCorr())
m_osci->CorrectTriggerPoint(m_frame->GetTrgPosition(0));
g_epcs->Enter();
status = 0;
if (m_frame->GetWFFile() || m_frame->GetWFfd()) {
status = m_osci->SaveWaveforms(m_frame->GetWFFile(), m_frame->GetWFfd());
m_frame->IncrementSaved();
}
g_epcs->Leave();
if (status < 0)
m_frame->CloseWFFile(true);
if (m_frame->GetWFFile() || m_frame->GetWFfd())
if (m_frame->GetNSaved() >= m_frame->GetNSaveMax())
m_frame->CloseWFFile(false);
m_frame->EvaluateMeasurements();
m_frame->IncrementAcquisitions();
// copy event from oscilloscope
int n = m_osci->IsMultiBoard() ? m_osci->GetNumberOfBoards() : 1;
g_epcs->Enter();
for (int i=0 ; i<n ; i++) {
for (int j=0 ; j<4 ; j++) {
memcpy(m_time[i][j], m_osci->GetTime(i, j), m_osci->GetWaveformDepth(j)*sizeof(float));
memcpy(m_waveform[i][j], m_osci->GetWaveform(i, j), m_osci->GetWaveformDepth(j)*sizeof(float));
}
}
g_epcs->Leave();
} else
wxThread::Sleep(10);
} else {
wxThread::Sleep(10);
m_active = false;
}
} while (!m_stopThread);
m_finished = true;
g_finished = true;
return NULL;
}
+29
View File
@@ -0,0 +1,29 @@
/*
* EPThread.h
* DRS oscilloscope event processor header file
* $Id: EPThread.h 21263 2014-02-07 16:38:07Z ritt $
*/
class EPThread : public wxThread
{
public:
EPThread(DOFrame *o);
~EPThread();
void *Entry();
float *GetTime(int b, int c) { return m_time[b][c]; }
float *GetWaveform(int b, int c) { return m_waveform[b][c]; }
void ClearWaveforms();
void Enable(bool flag);
void StopThread();
bool IsFinished() { return m_finished; }
private:
DOFrame *m_frame;
Osci *m_osci;
bool m_stopThread;
bool m_enabled;
bool m_active;
bool m_finished;
float m_waveform[MAX_N_BOARDS][4][2048];
float m_time[MAX_N_BOARDS][4][2048];
};
Binary file not shown.
@@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "DRSOsc16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "DRSOsc16x16x2.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "DRSOsc32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "DRSOsc32x32x2.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "DRSOsc128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "DRSOsc128x128x2.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "DRSOsc256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "DRSOsc256x256x2.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "DRSOsc512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "DRSOsc512x512x2.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

+59
View File
@@ -0,0 +1,59 @@
/*
* InfoDialog.cpp
* Info Dialog class
* $Id: InfoDialog.cpp 17646 2011-05-11 15:21:02Z ritt $
*/
#include "DRSOscInc.h"
extern char svn_revision[];
extern char drsosc_version[];
InfoDialog::InfoDialog(wxWindow* parent)
:
InfoDialog_fb( parent )
{
wxString str;
DOFrame *frame = (DOFrame*)parent;
DRSBoard *b = frame->GetOsci()->GetCurrentBoard();
int t = b->GetBoardType();
if (t == 5)
str.Printf(wxT("5 (Eval. 2.0)"));
else if (t == 6)
str.Printf(wxT("6 (Mezz. 1.4)"));
else if (t == 7)
str.Printf(wxT("7 (Eval. 3.0)"));
else if (t == 8)
str.Printf(wxT("8 (Eval. 4.0)"));
else
str.Printf(wxT("%d"), t);
m_stBoardType->SetLabel(str);
str.Printf(wxT("DRS%d"), b->GetDRSType());
m_stDRSType->SetLabel(str);
str.Printf(wxT("%d"), b->GetBoardSerialNumber());
m_stSerialNumber->SetLabel(str);
str.Printf(wxT("%d"), b->GetFirmwareVersion());
m_stFirmwareRevision->SetLabel(str);
str.Printf(wxT("%1.1lf"), b->GetTemperature());
m_stTemperature->SetLabel(str);
str.Printf(wxT("%1.2lgV...%1.2lgV"), b->GetInputRange()-0.5, b->GetInputRange()+0.5);
m_stInputRange->SetLabel(str);
str.Printf(wxT("%1.2lgV...%1.2lgV"), b->GetCalibratedInputRange()-0.5, b->GetCalibratedInputRange()+0.5);
m_stCalibratedRange->SetLabel(str);
str.Printf(wxT("%1.3lf GSPS"), b->GetCalibratedFrequency());
m_stCalibratedFrequency->SetLabel(str);
double freq;
b->ReadFrequency(0, &freq);
str.Printf(wxT("%1.3lf GSPS"), freq);
m_stFrequency->SetLabel(str);
}
+19
View File
@@ -0,0 +1,19 @@
#ifndef __InfoDialog__
#define __InfoDialog__
// $Id: InfoDialog.h 15243 2010-05-07 14:01:43Z ritt $
/**
@file
Subclass of InfoDialog_fb, which is generated by wxFormBuilder.
*/
/** Implementing ConfigDialog_fb */
class InfoDialog : public InfoDialog_fb
{
public:
/** Constructor */
InfoDialog( wxWindow* parent );
};
#endif // __InfoDialog__
+87
View File
@@ -0,0 +1,87 @@
########################################################
#
# Makefile for drsosc executable under linux
#
# Requires wxWidgets 2.8.9 or newer
#
# S. Ritt, Nov. 2016
########################################################
# determine OS
OSTYPE = $(shell uname)
# check if wxWidgets is installed
HAVE_WX = $(shell which wx-config)
ifeq ($(HAVE_WX),)
$(error Error: wxWidgets required to compile "drsosc")
endif
CFLAGS = -g -O2 -Wall -Wuninitialized -Wno-unused-result -fno-strict-aliasing -DHAVE_USB -DHAVE_LIBUSB10 -DUSE_DRS_MUTEX
CFLAGS += -I../include -I../ -I/usr/local/include
WXFLAGS = $(shell wx-config --cxxflags)
LIBS = -L/usr/local/lib -lpthread -lutil
LIBS += $(shell wx-config --libs)
WX_OBJ = ConfigDialog.o DOFrame.o DOScreen.o DRSOsc.o MeasureDialog.o Measurement.o Osci.o EPThread.o DisplayDialog.o InfoDialog.o AboutDialog.o TriggerDialog.o
OBJECTS = main.o musbstd.o DRS.o rb.o averager.o mxml.o strlcpy.o $(WX_OBJ)
OUTNAME = drsosc
# OS specific flags
ifeq ($(OSTYPE),Darwin)
CFLAGS += -DOS_DARWIN -stdlib=libstdc++
LIBS += -lusb-1.0
endif
ifeq ($(OSTYPE),Linux)
CFLAGS += -DOS_LINUX
LIBS += -lusb-1.0
endif
all: $(OUTNAME) read_binary
app: DRSOsc.app
$(OUTNAME): $(OBJECTS)
$(CXX) $(CFLAGS) $(OBJECTS) -o $(OUTNAME) $(LIBS)
DRSOsc.app: drsosc
-mkdir DRSOsc.app
-mkdir DRSOsc.app/Contents
-mkdir DRSOsc.app/Contents/MacOS
-mkdir DRSOsc.app/Contents/Resources
-mkdir DRSOsc.app/Contents/Resources/English.lproj
echo 'APPL????' > DRSOsc.app/Contents/PkgInfo
cp drsosc.xcodeproj/Info-processed.plist DRSOsc.app/Contents/Info.plist
cp drsosc DRSOsc.app/Contents/MacOS/DRSOsc
cp DRSOsc.icns DRSOsc.app/Contents/Resources
read_binary: read_binary.cpp
$(CXX) $(CFLAGS) -o $@ $<
main.o: %.o: %.cpp ../include/mxml.h ../include/DRS.h
$(CXX) $(CFLAGS) $(WXFLAGS) -c $<
musbstd.o: ../src/musbstd.c ../include/musbstd.h
$(CC) $(CFLAGS) -c $<
DRS.o: ../src/DRS.cpp ../include/DRS.h
$(CXX) $(CFLAGS) $(WXFLAGS) -c $<
rb.o: rb.cpp rb.h
$(CXX) $(CFLAGS) -c $<
averager.o: ../src/averager.cpp ../include/averager.h
$(CXX) $(CFLAGS) -c $<
mxml.o: ../src/mxml.c ../include/mxml.h
$(CC) $(CFLAGS) -c $<
strlcpy.o: ../src/strlcpy.c ../include/strlcpy.h
$(CC) $(CFLAGS) -c $<
$(WX_OBJ): %.o: %.cpp %.h ../include/mxml.h ../include/DRS.h
$(CXX) $(CFLAGS) $(WXFLAGS) -c $<
clean:
rm -f *.o $(OUTNAME) read_binary
+64
View File
@@ -0,0 +1,64 @@
/*
* ConfigDialog.cpp
* Modal Measurement Configuration Dialog class
* $Id: MeasureDialog.cpp 21271 2014-02-17 15:20:55Z ritt $
*/
#include "DRSOscInc.h"
MeasureDialog::MeasureDialog( wxWindow* parent )
:
MeasureDialog_fb( parent )
{
m_frame = (DOFrame *)parent;
}
void MeasureDialog::OnClose( wxCommandEvent& event )
{
this->Hide();
}
void MeasureDialog::OnButton( wxCommandEvent& event )
{
if (event.IsChecked() && event.GetId() >= ID_VS1 && event.GetId() <= ID_VS4)
wxMessageBox(wxT("Please use cursor A to set the location of the vertical slice"),
wxT("DRS Oscilloscope"), wxOK | wxICON_INFORMATION, this);
if (event.IsChecked() && event.GetId() >= ID_CHRG1 && event.GetId() <= ID_CHRG4)
wxMessageBox(wxT("Please use cursors A and B to define the integration region"),
wxT("DRS Oscilloscope"), wxOK | wxICON_INFORMATION, this);
if (event.IsChecked() && event.GetId() >= ID_HS1 && event.GetId() <= ID_HS4)
wxMessageBox(wxT("Please use cursor A to set the location of the horizontal slice"),
wxT("DRS Oscilloscope"), wxOK | wxICON_INFORMATION, this);
m_frame->SetMeasurement(event.GetId(), event.IsChecked());
}
void MeasureDialog::OnStat( wxCommandEvent& event )
{
m_frame->SetStat(event.IsChecked());
}
void MeasureDialog::OnHist( wxCommandEvent& event )
{
m_frame->SetHist(event.IsChecked());
}
void MeasureDialog::OnStatNAverage( wxCommandEvent& event )
{
wxString str = m_cbNAverage->GetValue();
char buf[100];
strcpy( buf, (const char*)str.mb_str(wxConvUTF8) );
m_frame->SetStatNStat(atoi(buf));
}
void MeasureDialog::OnIndicator( wxCommandEvent& event )
{
m_frame->SetIndicator(event.IsChecked());
}
void MeasureDialog::OnStatReset( wxCommandEvent& event )
{
m_frame->StatReset();
}
+33
View File
@@ -0,0 +1,33 @@
#ifndef __MeasureDialog__
#define __MeasureDialog__
/*
$Id: MeasureDialog.h 18557 2011-10-28 13:21:44Z ritt $
*/
class DOFrame;
#include "DRSOsc.h"
/** Implementing MeasureDialog_fb */
class MeasureDialog : public MeasureDialog_fb
{
protected:
// Handlers for MeasureDialog_fb events.
void OnClose( wxCommandEvent& event );
void OnButton( wxCommandEvent& event );
void OnStat( wxCommandEvent& event );
void OnHist( wxCommandEvent& event );
void OnStatNAverage( wxCommandEvent& event );
void OnIndicator( wxCommandEvent& event );
void OnStatReset( wxCommandEvent& event );
public:
/** Constructor */
MeasureDialog( wxWindow* parent );
private:
DOFrame *m_frame;
};
#endif // __MeasureDialog__
+801
View File
@@ -0,0 +1,801 @@
/*
* Measurement.cpp
* Measuremnet class implementation
* $Id: Measurement.cpp 21615 2015-02-25 09:31:08Z ritt $
*/
#include "DRSOscInc.h"
void linfit(double *x, double *y, int n, double &a, double &b);
Measurement::Measurement(DOFrame *frame, int index)
{
m_frame = frame;
m_index = index;
memset(m_param, 0, sizeof(m_param));
m_statIndex = 0;
m_nMeasured = 0;
m_nStat = 1000;
m_statArray = new double[m_nStat];
m_vsum = m_vvsum = 0;
m_min = m_max = 0;
ResetStat();
}
Measurement::~Measurement()
{
delete m_statArray;
}
void Measurement::ResetStat()
{
m_nMeasured = 0;
m_statIndex = 0;
}
void Measurement::SetNStat(int n)
{
if (n > 1000000)
n = 1000000;
if (n < 1)
n = 1;
m_nStat = n;
delete m_statArray;
m_statArray = new double[n];
ResetStat();
}
wxString Measurement::GetName()
{
switch (m_index) {
case 0: return wxT("Level"); break;
case 1: return wxT("Pk-Pk"); break;
case 2: return wxT("RMS"); break;
case 3: return wxT("VSlice"); break;
case 4: return wxT("Charge"); break;
case 5: return wxT("Freq"); break;
case 6: return wxT("Period"); break;
case 7: return wxT("Rise"); break;
case 8: return wxT("Fall"); break;
case 9: return wxT("Pos Width"); break;
case 10: return wxT("Neg Width"); break;
case 11: return wxT("Chn delay"); break;
case 12: return wxT("HSlice"); break;
default: return wxT("<undefined>"); break;
}
}
void Measurement::Measure(double *x1, double *y1, double *x2, double *y2, int n)
{
Measure(x1, y1, x2, y2, n, true, NULL);
}
double Measurement::Measure(double *x1, double *y1, double *x2, double *y2, int n, bool update, DOScreen *s)
{
double v;
int i, na;
switch (m_index) {
case 0: v = MLevel(x1, y1, n, s); break;
case 1: v = MPkPk(x1, y1, n, s); break;
case 2: v = MRMS(x1, y1, n, s); break;
case 3: v = MVSlice(x1, y1, n, s); break;
case 4: v = MCharge(x1, y1, n, s); break;
case 5: v = MFreq(x1, y1, n, s); break;
case 6: v = MPeriod(x1, y1, n, s); break;
case 7: v = MRise(x1, y1, n, s); break;
case 8: v = MFall(x1, y1, n, s); break;
case 9: v = MPosWidth(x1, y1, n, s); break;
case 10: v = MNegWidth(x1, y1, n, s); break;
case 11: v = MChnDelay(x1, y1, x2, y2, n, s); break;
case 12: v = MHSlice(x1, y1, n, s); break;
default: v = 0; break;
}
m_value = v;
/* update statistics */
if (update && !ss_isnan(v)) {
m_statArray[m_statIndex] = v;
m_statIndex = (m_statIndex + 1) % m_nStat;
if (m_nMeasured < m_nStat) {
m_nMeasured++;
na = m_nMeasured;
} else {
na = m_nStat;
}
m_vsum = m_vvsum = 0;
m_min = m_max = v;
for (i=0 ; i<na ; i++) {
m_vsum += m_statArray[i];
m_vvsum += (m_statArray[i] * m_statArray[i]);
if (m_statArray[i] < m_min)
m_min = m_statArray[i];
if (m_statArray[i] > m_max)
m_max = m_statArray[i];
}
}
return v;
}
wxString Measurement::GetString()
{
wxString str;
if (ss_isnan(m_value))
str.Printf(wxT(" N/A"));
else {
switch (m_index) {
case 0:
case 1:
case 2:
case 3: str.Printf(wxT("%6.1lf mV"), m_value); break;
case 4: str.Printf(wxT("%6.1lf pC"), m_value); break;
case 5: str.Printf(wxT("%6.1lf MHz"), m_value); break;
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12: str.Printf(wxT("%6.3lf ns"), m_value); break;
}
}
return str;
}
wxString Measurement::GetStat()
{
double mean, std;
if (m_nMeasured == 0) {
mean = 0;
std = 0;
} else {
mean = m_vsum / m_nMeasured;
std = sqrt(m_vvsum/m_nMeasured - m_vsum*m_vsum/m_nMeasured/m_nMeasured);
}
wxString str;
if (ss_isnan(m_min) || ss_isnan(m_max))
str.Printf(wxT(" N/A N/A N/A N/A %6d"), m_nMeasured);
else
str.Printf(wxT("%8.3lf %8.3lf %8.3lf %8.4lf %6d"), m_min, m_max, mean, std, m_nMeasured);
return str;
}
double Measurement::MLevel(double *x, double *y, int n, DOScreen *s)
{
double l = 0;
for (int i=0 ; i<n ; i++)
l += y[i];
if (n > 0)
l /= n;
if (s) {
s->GetDC()->DrawLine(s->timeToX(x[0]), s->voltToY(l),
s->timeToX(x[n-1]), s->voltToY(l));
}
return l;
}
double Measurement::MPkPk(double *x, double *y, int n, DOScreen *s)
{
double min_x, min_y, max_x, max_y;
min_x = max_x = x[0];
min_y = max_y = y[0];
for (int i=0 ; i<n ; i++) {
if (y[i] < min_y) {
min_x = x[i];
min_y = y[i];
}
if (y[i] > max_y) {
max_x = x[i];
max_y = y[i];
}
}
if (s) {
int x_min = s->timeToX(min_x);
int x_max = s->timeToX(max_x);
int y_min = s->voltToY(min_y);
int y_max = s->voltToY(max_y);
int x_center = (x_min + x_max) / 2;
if (x_max > x_min) {
s->GetDC()->DrawLine(x_min-20, y_min, x_center+20, y_min);
s->GetDC()->DrawLine(x_center-20, y_max, x_max+20, y_max);
} else {
s->GetDC()->DrawLine(x_max-20, y_max, x_center+20, y_max);
s->GetDC()->DrawLine(x_center-20, y_min, x_min+20, y_min);
}
s->GetDC()->DrawLine(x_center, y_max, x_center, y_min);
s->GetDC()->DrawLine(x_center, y_max, x_center+2, y_max+6);
s->GetDC()->DrawLine(x_center, y_max, x_center-2, y_max+6);
s->GetDC()->DrawLine(x_center, y_min, x_center+2, y_min-6);
s->GetDC()->DrawLine(x_center, y_min, x_center-2, y_min-6);
}
return max_y-min_y;
}
double Measurement::MRMS(double *x, double *y, int n, DOScreen *s)
{
double mean = 0;
double rms = 0;
if (n <= 0)
return 0;
for (int i=0 ; i<n ; i++)
mean += y[i];
mean /= n;
for (int i=0 ; i<n ; i++)
rms += (y[i]-mean)*(y[i]-mean);
rms = sqrt(rms/n);
if (s) {
int ym = s->voltToY(mean);
for (int i=0 ; i<n ; i++)
s->GetDC()->DrawLine(s->timeToX(x[i]), ym, s->timeToX(x[i]), s->voltToY(y[i]));
}
return rms;
}
double Measurement::MVSlice(double *x, double *y, int n, DOScreen *s)
{
int i;
double u = 0;
if (n <= 0)
return 0;
for (i=0 ; i<n-1 ; i++)
if (x[i] <= m_param[0] && x[i+1] > m_param[0])
break;
if (i == n-1)
return ss_nan();
if (x[i+1] - x[i] == 0)
return ss_nan();
u = y[i] + (y[i+1]-y[i]) * (m_param[0] - x[i]) / (x[i+1] - x[i]);
if (s) {
s->GetDC()->DrawLine(s->timeToX(m_param[0]), s->GetY1(), s->timeToX(m_param[0]), s->GetY2());
}
return u;
}
double Measurement::MCharge(double *x, double *y, int n, DOScreen *s)
{
double q = 0;
double x1, x2, y1, y2;
if (n <= 0)
return 0;
for (int i=0 ; i<n ; i++) {
if (x[i+1] >= m_param[0] && x[i] <= m_param[2]) {
if (x[i] < m_param[0]) {
x1 = m_param[0];
y1 = y[i] + (y[i+1]-y[i]) * (m_param[0] - x[i]) / (x[i+1] - x[i]);
} else {
x1 = x[i];
y1 = y[i];
}
if (x[i+1] > m_param[2]) {
x2 = m_param[2];
y2 = y[i] + (y[i+1]-y[i]) * (m_param[2] - x[i]) / (x[i+1] - x[i]);
} else {
x2 = x[i+1];
y2 = y[i+1];
}
q += 0.5 * (y1 + y2) * (x2 - x1);
if (s) {
wxPoint p[4];
p[0] = wxPoint(s->timeToX(x1), s->voltToY(0));
p[1] = wxPoint(s->timeToX(x1), s->voltToY(y1));
p[2] = wxPoint(s->timeToX(x2), s->voltToY(y2));
p[3] = wxPoint(s->timeToX(x2), s->voltToY(0));
s->GetDC()->DrawPolygon(4, p, 0, 0);
}
}
}
return q / 50; // signal into 50 Ohm
}
/*-------------------------------------------------------------------------*/
double Measurement::MFreq(double *x, double *y, int n, DOScreen *s)
{
double p = MPeriod(x, y, n, s);
if (ss_isnan(p) || p == 0)
return ss_nan();
return 1000/p;
}
double Measurement::MPeriod(double *x, double *y, int n, DOScreen *s)
{
int i, pos_edge, n_pos, n_neg;
double miny, maxy, mean, t1, t2;
if (n <= 0)
return 0;
miny = maxy = y[0];
mean = 0;
for (i=0 ; i<n ; i++) {
if (y[i] > maxy)
maxy = y[i];
if (y[i] < miny)
miny = y[i];
mean += y[i];
}
if (n < 5 || maxy - miny < 10)
return ss_nan();
mean = mean/n;
/* count zero crossings */
n_pos = n_neg = 0;
for (i=1 ; i<n ; i++) {
if (y[i] > mean && y[i-1] <= mean)
n_pos++;
if (y[i] < mean && y[i-1] >= mean)
n_neg++;
}
/* search for zero crossing */
for (i=n/2+2 ; i>1 ; i--) {
if (n_pos > 1 && y[i] > mean && y[i-1] <= mean)
break;
if (n_neg > 1 && y[i] < mean && y[i-1] >= mean)
break;
}
if (i == 1)
for (i=n/2 ; i<n ; i++) {
if (n_pos > 1 && y[i] > mean && y[i-1] <= mean)
break;
if (n_neg > 1 && y[i] < mean && y[i-1] >= mean)
break;
}
if (i == n)
return ss_nan();
pos_edge = y[i] > mean;
t1 = (mean*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
/* search next zero crossing */
for (i++ ; i<n ; i++) {
if (pos_edge && y[i] > mean && y[i-1] <= mean)
break;
if (!pos_edge && y[i] < mean && y[i-1] >= mean)
break;
}
if (i == n)
return ss_nan();
t2 = (mean*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
if (s) {
int ym = s->voltToY(mean);
int x1 = s->timeToX(t1);
int x2 = s->timeToX(t2);
s->GetDC()->DrawLine(x1, ym-10, x1, ym+10);
s->GetDC()->DrawLine(x2, ym-10, x2, ym+10);
s->GetDC()->DrawLine(x1, ym, x2, ym);
s->GetDC()->DrawLine(x1, ym, x1+6, ym-2);
s->GetDC()->DrawLine(x1, ym, x1+6, ym+2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym-2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym+2);
}
return t2 - t1;
}
double Measurement::MRise(double *x, double *y, int n, DOScreen *s)
{
int i;
double miny, maxy, t1, t2, y10, y90;
if (n <= 0)
return 0;
miny = maxy = y[0];
for (i=0 ; i<n ; i++) {
if (y[i] > maxy)
maxy = y[i];
if (y[i] < miny)
miny = y[i];
}
if (maxy - miny < 10)
return ss_nan();
y10 = miny+0.1*(maxy-miny);
y90 = miny+0.9*(maxy-miny);
/* search for 10% level crossing */
for (i=n/2+2 ; i>1 ; i--)
if (y[i] > y10 && y[i-1] <= y10)
break;
if (i == 1)
for (i=n/2 ; i<n ; i++) {
if (y[i] > y10 && y[i-1] <= y10)
break;
}
if (i == n)
return ss_nan();
t1 = (y10*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
/* search for 90% level crossing */
for (i++ ; i<n ; i++)
if (y[i] > y90 && y[i-1] <= y90)
break;
if (i == n)
return ss_nan();
t2 = (y90*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
if (s) {
int y1 = s->voltToY(y10);
int y2 = s->voltToY(y90);
int x1 = s->timeToX(t1);
int x2 = s->timeToX(t2);
int ym = (y1 + y2)/2;
s->GetDC()->DrawLine(x1, y1+10, x1, ym-10);
s->GetDC()->DrawLine(x2, y2-10, x2, ym+10);
s->GetDC()->DrawLine(x1, ym, x2, ym);
s->GetDC()->DrawLine(x1, ym, x1+6, ym-2);
s->GetDC()->DrawLine(x1, ym, x1+6, ym+2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym-2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym+2);
}
return t2 - t1;
}
double Measurement::MFall(double *x, double *y, int n, DOScreen *s)
{
int i;
double miny, maxy, t1, t2, y10, y90;
if (n <= 0)
return 0;
miny = maxy = y[0];
for (i=0 ; i<n ; i++) {
if (y[i] > maxy)
maxy = y[i];
if (y[i] < miny)
miny = y[i];
}
if (maxy - miny < 10)
return ss_nan();
y10 = miny+0.1*(maxy-miny);
y90 = miny+0.9*(maxy-miny);
/* search for 90% level crossing */
for (i=n/2+2 ; i>1 ; i--)
if (y[i] < y90 && y[i-1] >= y90)
break;
if (i == 1)
for (i=n/2 ; i<n ; i++) {
if (y[i] < y90 && y[i-1] >= y90)
break;
}
if (i == n)
return ss_nan();
t1 = (y90*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
/* search for 10% level crossing */
for (i++ ; i<n ; i++)
if (y[i] < y10 && y[i-1] >= y10)
break;
if (i == n)
return ss_nan();
t2 = (y10*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
if (s) {
int y1 = s->voltToY(y90);
int y2 = s->voltToY(y10);
int x1 = s->timeToX(t1);
int x2 = s->timeToX(t2);
int ym = (y1 + y2)/2;
s->GetDC()->DrawLine(x1, y1-10, x1, ym+10);
s->GetDC()->DrawLine(x2, y2+10, x2, ym-10);
s->GetDC()->DrawLine(x1, ym, x2, ym);
s->GetDC()->DrawLine(x1, ym, x1+6, ym-2);
s->GetDC()->DrawLine(x1, ym, x1+6, ym+2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym-2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym+2);
}
return t2 - t1;
}
double Measurement::MPosWidth(double *x, double *y, int n, DOScreen *s)
{
int i;
double miny, maxy, mean, t1, t2;
if (n <= 0)
return 0;
miny = maxy = y[0];
for (i=0 ; i<n ; i++) {
if (y[i] > maxy)
maxy = y[i];
if (y[i] < miny)
miny = y[i];
}
mean = (miny + maxy)/2;
if (maxy - miny < 10)
return ss_nan();
/* search for first pos zero crossing */
for (i=1 ; i<n ; i++)
if (y[i] > mean && y[i-1] <= mean)
break;
if (i == n)
return ss_nan();
t1 = (mean*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
/* search next neg zero crossing */
for (i++ ; i<n ; i++)
if (y[i] < mean && y[i-1] >= mean)
break;
if (i == n)
return ss_nan();
t2 = (mean*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
if (s) {
int ym = s->voltToY(mean);
int x1 = s->timeToX(t1);
int x2 = s->timeToX(t2);
s->GetDC()->DrawLine(x1, ym-10, x1, ym+10);
s->GetDC()->DrawLine(x2, ym-10, x2, ym+10);
s->GetDC()->DrawLine(x1, ym, x2, ym);
s->GetDC()->DrawLine(x1, ym, x1+6, ym-2);
s->GetDC()->DrawLine(x1, ym, x1+6, ym+2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym-2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym+2);
}
return t2 - t1;
}
double Measurement::MNegWidth(double *x, double *y, int n, DOScreen *s)
{
int i;
double miny, maxy, mean, t1, t2;
if (n <= 0)
return 0;
miny = maxy = y[0];
for (i=0 ; i<n ; i++) {
if (y[i] > maxy)
maxy = y[i];
if (y[i] < miny)
miny = y[i];
}
mean = (miny + maxy)/2;
if (maxy - miny < 10)
return ss_nan();
/* search for first neg zero crossing */
for (i=1 ; i<n ; i++)
if (y[i] < mean && y[i-1] >= mean)
break;
if (i == n)
return ss_nan();
t1 = (mean*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
/* search next pos zero crossing */
for (i++ ; i<n ; i++)
if (y[i] > mean && y[i-1] <= mean)
break;
if (i == n)
return ss_nan();
t2 = (mean*(x[i]-x[i-1])+x[i-1]*y[i]-x[i]*y[i-1])/(y[i]-y[i-1]);
if (s) {
int ym = s->voltToY(mean);
int x1 = s->timeToX(t1);
int x2 = s->timeToX(t2);
s->GetDC()->DrawLine(x1, ym-10, x1, ym+10);
s->GetDC()->DrawLine(x2, ym-10, x2, ym+10);
s->GetDC()->DrawLine(x1, ym, x2, ym);
s->GetDC()->DrawLine(x1, ym, x1+6, ym-2);
s->GetDC()->DrawLine(x1, ym, x1+6, ym+2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym-2);
s->GetDC()->DrawLine(x2, ym, x2-6, ym+2);
}
return t2 - t1;
}
#define N_FIT 0
void linfit(double *x, double *y, int n, double &a, double &b)
{
int i;
double sx, sxx, sy, syy, sxy;
sx = sxx = sy = syy = sxy = 0;
for (i=0 ; i<n ; i++) {
sx += x[i];
sy += y[i];
sxy += x[i]*y[i];
sxx += x[i]*x[i];
syy += y[i]*y[i];
}
b = (sxy - sx*sy/n) / (sxx - sx*sx/n);
a = sy/n-b*sx/n;
return;
}
double Measurement::MChnDelay(double *x1, double *y1, double *x2, double *y2, int n, DOScreen *s)
{
int i, pol, i1l, i1r, i2l, i2r;
double t1, t2, thr, a, b;
if (n <= 0)
return 0;
thr = m_frame->GetTrgLevel(0) * 1000;
pol = m_frame->GetTrgPolarity();
for (i=1 ; i<n ; i++) {
if (pol == 1 && y1[i] < thr && y1[i-1] >= thr)
break;
if (pol == 0 && y1[i] > thr && y1[i-1] <= thr)
break;
}
if (i == n)
return ss_nan();
t1 = (thr*(x1[i]-x1[i-1])+x1[i-1]*y1[i]-x1[i]*y1[i-1])/(y1[i]-y1[i-1]);
if (N_FIT > 0 && i>=N_FIT/2) {
i1l = i-N_FIT/2;
i1r = i1l+N_FIT-1;
linfit(&x1[i-N_FIT/2], &y1[i-N_FIT/2], N_FIT, a, b);
if (b != 0)
t1 = (thr-a)/b;
if (s) {
int xa = s->timeToX(x1[i1l]);
int ya = s->voltToY(s->GetCurChn(), a+b*x1[i1l]);
int xb = s->timeToX(x1[i1r]);
int yb = s->voltToY(s->GetCurChn(), a+b*x1[i1r]);
s->GetDC()->DrawLine(xa, ya, xb, yb);
}
}
for (i=1 ; i<n ; i++) {
if (pol == 1 && y2[i] < thr && y2[i-1] >= thr)
break;
if (pol == 0 && y2[i] > thr && y2[i-1] <= thr)
break;
}
if (i == n)
return ss_nan();
t2 = (thr*(x2[i]-x2[i-1])+x2[i-1]*y2[i]-x2[i]*y2[i-1])/(y2[i]-y2[i-1]);
if (N_FIT > 0 && i>=N_FIT/2) {
i2l = i-N_FIT/2;
i2r = i2l+N_FIT-1;
linfit(&x2[i-N_FIT/2], &y2[i-N_FIT/2], N_FIT, a, b);
if (b != 0)
t2 = (thr-a)/b;
if (s) {
int xa = s->timeToX(x2[i2l]);
int ya = s->voltToY(s->GetCurChn(), a+b*x2[i2l]);
int xb = s->timeToX(x2[i2r]);
int yb = s->voltToY(s->GetCurChn(), a+b*x2[i2r]);
s->GetDC()->DrawLine(xa, ya, xb, yb);
}
}
if (s) {
if (s->GetChnOn(0, (s->GetCurChn()+1)%4)) { /// ### TBG: change board index
int ym1 = s->voltToY(s->GetCurChn(), thr);
int ym2 = s->voltToY((s->GetCurChn()+1)%4, thr);
int xa = s->timeToX(t1);
int xb = s->timeToX(t2);
int ymm = (ym1+ym2)/2;
if (ym1 < ym2) {
s->GetDC()->DrawLine(xa, ym1-10, xa, ymm+10);
s->GetDC()->DrawLine(xb, ymm-10, xb, ym2+10);
} else {
s->GetDC()->DrawLine(xa, ym1+10, xa, ymm-10);
s->GetDC()->DrawLine(xb, ymm+10, xb, ym2-10);
}
s->GetDC()->DrawLine(xa, ymm, xb, ymm);
s->GetDC()->DrawLine(xa, ymm, xa+6, ymm-2);
s->GetDC()->DrawLine(xa, ymm, xa+6, ymm+2);
s->GetDC()->DrawLine(xb, ymm, xb-6, ymm-2);
s->GetDC()->DrawLine(xb, ymm, xb-6, ymm+2);
}
}
return t2 - t1;
}
double Measurement::MHSlice(double *x, double *y, int n, DOScreen *s)
{
int i;
double tmin = ss_nan();
double t, dtmin = 1E6;;
if (n <= 0)
return 0;
for (i=0 ; i<n-1 ; i++) {
if ((y[i] <= m_param[1] && y[i+1] > m_param[1]) ||
(y[i] >= m_param[1] && y[i+1] < m_param[1])) {
if (y[i+1] - y[i] == 0)
continue;
t = x[i] + (x[i+1]-x[i]) * (m_param[1] - y[i]) / (y[i+1] - y[i]);
if (fabs(t - m_param[0]) < dtmin) {
dtmin = fabs(t - m_param[0]);
tmin = t;
}
}
}
if (s) {
s->GetDC()->DrawLine(s->GetX1(), s->voltToY(m_param[1]), s->GetX2(), s->voltToY(m_param[1]));
}
return tmin;
}
+60
View File
@@ -0,0 +1,60 @@
/*
$Id: Measurement.h 21271 2014-02-17 15:20:55Z ritt $
*/
class DOScreen;
class DOFrame;
class Measurement
{
protected:
DOFrame *m_frame;
wxString m_name;
int m_index;
double m_value;
double m_param[4];
double *m_statArray;
int m_statIndex;
int m_nMeasured;
int m_nStat;
double m_vsum;
double m_vvsum;
double m_min;
double m_max;
public:
/** Constructor & Desctructor */
Measurement(DOFrame *frame, int index);
~Measurement();
wxString GetName();
wxString GetUnit();
double Measure(double *x1, double *y1, double *x2, double *y2, int n, bool update, DOScreen *s);
void Measure(double *x1, double *y1, double *x2, double *y2, int n);
wxString GetString();
wxString GetStat();
void SetNStat(int n);
int GetNStat() { return m_nStat; }
int GetNMeasured() { return m_nMeasured; }
void ResetStat();
double *GetArray() { return m_statArray; }
void SetParam(int i, double p) { if (i<4) m_param[i] = p; }
double GetParam(int i) { return m_param[i]; }
static const int N_MEASUREMENTS = 13;
private:
double MLevel(double *x1, double *y1, int n, DOScreen *s);
double MPkPk(double *x1, double *y1, int n, DOScreen *s);
double MRMS(double *x1, double *y1, int n, DOScreen *s);
double MVSlice(double *x1, double *y1, int n, DOScreen *s);
double MCharge(double *x1, double *y1, int n, DOScreen *s);
double MFreq(double *x1, double *y1, int n, DOScreen *s);
double MPeriod(double *x1, double *y1, int n, DOScreen *s);
double MRise(double *x1, double *y1, int n, DOScreen *s);
double MFall(double *x1, double *y1, int n, DOScreen *s);
double MPosWidth(double *x1, double *y1, int n, DOScreen *s);
double MNegWidth(double *x1, double *y1, int n, DOScreen *s);
double MChnDelay(double *x1, double *y1, double *x2, double *y2, int n, DOScreen *s);
double MHSlice(double *x1, double *y1, int n, DOScreen *s);
};
File diff suppressed because it is too large Load Diff
+171
View File
@@ -0,0 +1,171 @@
/*
* Osci.h
* DRS oscilloscope header file
* $Id: Osci.h 21496 2014-09-26 14:55:49Z ritt $
*/
typedef struct {
unsigned short Year;
unsigned short Month;
unsigned short Day;
unsigned short Hour;
unsigned short Minute;
unsigned short Second;
unsigned short Milliseconds;
} TIMESTAMP;
#define TM_AUTO 0
#define TM_NORMAL 1
/*------------------------------------------------------------------*/
class Osci;
class OsciThread : public wxThread
{
public:
OsciThread(Osci *o);
bool IsIdle();
void *Entry();
void ResetSW();
void Enable(bool flag);
void StopThread();
bool IsFinished() { return m_finished; }
private:
Osci *m_osci;
wxStopWatch m_sw1, m_sw2;
bool m_enabled;
bool m_active;
bool m_finished;
bool m_stopThread;
};
/*------------------------------------------------------------------*/
class Osci
{
public:
Osci(double samplingSpeed = 5, bool mthread = true);
~Osci();
void StopThread(void);
int ScanBoards();
int GetNumberOfBoards() { return m_drs->GetNumberOfBoards(); }
DRSBoard *GetBoard(int i) { return m_drs->GetBoard(i); }
DRSBoard *GetCurrentBoard() { return m_drs->GetBoard(m_board); }
int GetCurrentBoardIndex() { return m_board; }
DRS *GetDRS() { return m_drs; }
bool GetError(char *str, int size) { return m_drs->GetError(str, size); }
void CheckTimingCalibration();
void SelectBoard(int board);
void SelectChannel(int firstChannel, int chnSection);
void SetMultiBoard(bool multi);
bool IsMultiBoard() { return m_multiBoard; }
void SetRunning(bool flag);
void Enable(bool flag);
bool IsRunning() { return m_running; }
void SetSingle(bool flag);
bool IsSingle() { return m_single; }
void SetArmed(bool flag) { m_armed = flag; }
bool IsArmed() { return m_armed; }
bool IsIdle();
int GetWaveformDepth(int channel);
double GetWaveformLength() { return m_waveDepth / GetSamplingSpeed(); }
float *GetWaveform(int b, int i) { return (float *)m_waveform[b][i]; }
float *GetTime(int board, int channel);
int GetChip() { return m_chip; }
void SetSamplingSpeed(double freq);
double GetSamplingSpeed();
double GetTrueSamplingSpeed();
double GetMinSamplingSpeed();
double GetMaxSamplingSpeed();
bool IsTCalibrated();
bool IsVCalibrated();
bool GetTimeCalibration(int chip, int channel, int mode, float *time, bool force=false);
void Start();
void Stop();
void DrainEvents();
void SingleTrigger();
void ReadWaveforms();
int SaveWaveforms(MXML_WRITER *, int);
bool HasTriggered();
bool HasNewEvent();
void SetTriggerLevel(double level);
void SetTriggerPolarity(bool negative);
void SetIndividualTriggerLevel(int i, double level);
void SetTriggerDelay(int delay);
int GetTriggerDelay();
double GetTriggerDelayNs();
void SetTriggerMode(int mode) { m_trgMode = mode; }
int GetTriggerMode() { return m_trgMode; }
void SetTriggerSource(int source);
int GetTriggerSource() { return m_trgSource[m_board]; }
void SetTriggerConfig(int tc);
void SetRefclk(int board, bool flag);
void SetChnOn(int board, int chn, bool flag);
void SetClkOn(bool flag);
void SetEventSerial(int serial) { m_evSerial = serial; }
void SetCalibVoltage(bool flag, double voltage);
void SetInputRange(double center);
double GetInputRange() { return m_inputRange; }
double GetCalibratedInputRange();
unsigned int GetScaler(int channel);
void SetCalibrated(bool flag) { m_calibrated = flag; }
void SetCalibrated2(bool flag) { m_calibrated2 = flag; }
void SetTCalOn(bool flag) { m_tcalon = flag; }
bool IsTCalOn() { return m_tcalon; }
void SetRotated(bool flag) { m_rotated = flag; }
void SetSpikeRemoval(bool flag) { m_spikeRemoval = flag; }
void CorrectTriggerPoint(double t);
void RemoveSpikes(int board, bool cascading);
int CheckWaveforms();
bool SkipDisplay(void) { return m_skipDisplay; }
int GetChnSection(void) { return m_chnSection; }
char *GetDebugMsg(void) { return m_debugMsg; }
private:
DRS *m_drs;
OsciThread *m_thread;
bool m_running;
bool m_single;
bool m_armed;
double m_samplingSpeed;
int m_nBoards;
float m_waveform[MAX_N_BOARDS][4][2048];
float m_refwaveform[2048];
unsigned char m_wavebuffer[MAX_N_BOARDS][9*1024*2];
float m_time[MAX_N_BOARDS][4][2048];
float m_timeClk[MAX_N_BOARDS][1024];
int m_triggerCell[MAX_N_BOARDS];
int m_writeSR[MAX_N_BOARDS];
int m_boardSerial[MAX_N_BOARDS];
int m_waveDepth;
int m_trgMode;
int m_trgSource[MAX_N_BOARDS];
bool m_trgNegative;
int m_trgDelay;
double m_trgLevel[4];
bool m_chnOn[MAX_N_BOARDS][4];
bool m_clkOn;
bool m_refClk[MAX_N_BOARDS];
bool m_calibOn;
int m_evSerial;
TIMESTAMP m_evTimestamp;
bool m_calibrated;
bool m_calibrated2;
bool m_tcalon;
bool m_rotated;
int m_nDRS;
int m_board;
int m_chip;
int m_chnOffset;
int m_chnSection;
bool m_spikeRemoval;
double m_inputRange;
bool m_skipDisplay;
bool m_multiBoard;
char m_debugMsg[256];
};
/*------------------------------------------------------------------*/
+141
View File
@@ -0,0 +1,141 @@
/*
* TriggerDialog.cpp
* Modal Trigger Configuration Dialog class
* $Id: TriggerDialog.cpp 22292 2016-04-28 10:31:04Z ritt $
*/
#include "DRSOscInc.h"
TriggerDialog::TriggerDialog( wxWindow* parent )
:
TriggerDialog_fb( parent )
{
m_frame = (DOFrame *)parent;
m_board = 0;
UpdateControls();
}
void TriggerDialog::UpdateControls()
{
if (!m_frame->IsTrgConfigEnabled()) {
m_cbOR1->Disable();
m_cbOR2->Disable();
m_cbOR3->Disable();
m_cbOR4->Disable();
m_cbOREXT->Disable();
m_cbAND1->Disable();
m_cbAND2->Disable();
m_cbAND3->Disable();
m_cbAND4->Disable();
m_cbANDEXT->Disable();
m_cbTrans->Disable();
m_tbLevel1->Disable();
m_tbLevel2->Disable();
m_tbLevel3->Disable();
m_tbLevel4->Disable();
} else {
m_cbOR1->Enable();
m_cbOR2->Enable();
m_cbOR3->Enable();
m_cbOR4->Enable();
m_cbOREXT->Enable();
m_cbAND1->Enable();
m_cbAND2->Enable();
m_cbAND3->Enable();
m_cbAND4->Enable();
m_cbANDEXT->Enable();
m_cbTrans->Enable();
m_tbLevel1->Enable();
m_tbLevel2->Enable();
m_tbLevel3->Enable();
m_tbLevel4->Enable();
int tc = m_frame->GetTriggerConfig();
m_cbOR1->SetValue((tc & (1<<0))>0);
m_cbOR2->SetValue((tc & (1<<1))>0);
m_cbOR3->SetValue((tc & (1<<2))>0);
m_cbOR4->SetValue((tc & (1<<3))>0);
m_cbOREXT->SetValue((tc & (1<<4))>0);
m_cbAND1->SetValue((tc & (1<<8))>0);
m_cbAND2->SetValue((tc & (1<<9))>0);
m_cbAND3->SetValue((tc & (1<<10))>0);
m_cbAND4->SetValue((tc & (1<<11))>0);
m_cbANDEXT->SetValue((tc & (1<<12))>0);
m_cbTrans->SetValue((tc & (1<<15))>0);
wxString s;
s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(0));
m_tbLevel1->SetValue(s);
s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(1));
m_tbLevel2->SetValue(s);
s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(2));
m_tbLevel3->SetValue(s);
s.Printf(wxT("%1.3lf"), m_frame->GetTrgLevel(3));
m_tbLevel4->SetValue(s);
}
}
void TriggerDialog::OnClose( wxCommandEvent& event )
{
this->Hide();
}
void TriggerDialog::OnButton( wxCommandEvent& event )
{
if (event.GetId() == ID_TRANS) {
DRSBoard *b = m_frame->GetOsci()->GetCurrentBoard();
if (b->GetFirmwareVersion() < 21699) {
wxMessageBox(wxT("For this operation a boards with firmware\nrevision >= 21699 is required"),
wxT("DRS Oscilloscope"), wxOK | wxICON_STOP, this);
m_cbTrans->SetValue(false);
return;
}
if (event.IsChecked()) {
m_cbOREXT->SetValue(false);
m_cbOREXT->Disable();
m_cbANDEXT->SetValue(false);
m_cbANDEXT->Disable();
} else {
m_cbOREXT->Enable();
m_cbANDEXT->Enable();
}
}
m_frame->SetTriggerConfig(event.GetId(), event.IsChecked());
}
void TriggerDialog::OnTriggerLevel( wxCommandEvent& event )
{
if (event.GetId() == ID_LEVEL1)
m_frame->SetTrgLevel(0, atof(m_tbLevel1->GetValue().mb_str()));
if (event.GetId() == ID_LEVEL2)
m_frame->SetTrgLevel(1, atof(m_tbLevel2->GetValue().mb_str()));
if (event.GetId() == ID_LEVEL3)
m_frame->SetTrgLevel(2, atof(m_tbLevel3->GetValue().mb_str()));
if (event.GetId() == ID_LEVEL4)
m_frame->SetTrgLevel(3, atof(m_tbLevel4->GetValue().mb_str()));
}
void TriggerDialog::SetTriggerLevel(double level)
{
wxString s;
s.Printf(wxT("%1.3lf"), level);
m_tbLevel1->SetValue(s);
m_tbLevel2->SetValue(s);
m_tbLevel3->SetValue(s);
m_tbLevel4->SetValue(s);
}
void TriggerDialog::SelectBoard(int board)
{
m_board = board;
UpdateControls();
}
+34
View File
@@ -0,0 +1,34 @@
#ifndef __TriggerDialog__
#define __TriggerDialog__
/*
$Id: TriggerDialog.h 22292 2016-04-28 10:31:04Z ritt $
*/
class DOFrame;
#include "DRSOsc.h"
/** Implementing TriggerDialog_fb */
class TriggerDialog : public TriggerDialog_fb
{
protected:
// Handlers for TriggerDialog_fb events.
void OnClose( wxCommandEvent& event );
void OnButton( wxCommandEvent& event );
void OnTriggerLevel( wxCommandEvent& event );
public:
/** Constructor */
TriggerDialog( wxWindow* parent );
void SetTriggerLevel(double level);
void SelectBoard(int board);
private:
DOFrame *m_frame;
int m_board;
void UpdateControls();
};
#endif // __TriggerDialog__
File diff suppressed because it is too large Load Diff
+27
View File
@@ -0,0 +1,27 @@
/* XPM */
static const char *down_xpm[]={
"28 20 4 1",
". c None",
"a c #808080",
"b c #c0c0c0",
"# c #ffffff",
"............................",
"............................",
"............................",
".#########################a.",
".#bbbbbbbbbbbbbbbbbbbbbbbba.",
"..bbbbbbbbbbbbbbbbbbbbbbbba.",
"...bbbbbbbbbbbbbbbbbbbbbbaa.",
"....bbbbbbbbbbbbbbbbbbbbaa..",
".....bbbbbbbbbbbbbbbbbbaa...",
"......bbbbbbbbbbbbbbbbaa....",
".......bbbbbbbbbbbbbbaa.....",
"........bbbbbbbbbbbbaa......",
".........bbbbbbbbbbaa.......",
"..........bbbbbbbbaa........",
"...........bbbbbbaa.........",
"............bbbbaa..........",
".............bbaa...........",
"..............aa............",
"............................",
"............................"};
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

+1
View File
@@ -0,0 +1 @@
drsosc ICON "drsosc.ico"
+20
View File
@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "drsosc", "drsosc.vcxproj", "{668C949B-D0A7-4CCC-BC8F-5F8731DFBCD1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{668C949B-D0A7-4CCC-BC8F-5F8731DFBCD1}.Debug|Win32.ActiveCfg = Debug|Win32
{668C949B-D0A7-4CCC-BC8F-5F8731DFBCD1}.Debug|Win32.Build.0 = Debug|Win32
{668C949B-D0A7-4CCC-BC8F-5F8731DFBCD1}.Release|Win32.ActiveCfg = Release|Win32
{668C949B-D0A7-4CCC-BC8F-5F8731DFBCD1}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+342
View File
@@ -0,0 +1,342 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="drsosc"
ProjectGUID="{668C949B-D0A7-4CCC-BC8F-5F8731DFBCD1}"
RootNamespace="drsosc"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UseUnicodeResponseFiles="false"
Optimization="0"
AdditionalIncludeDirectories="C:\midas\drivers\vme\sis3100\windows;\wxWidgets-2.8.10\include;\wxWidgets-2.8.10\include\msvc;..\;\mxml;\midas\include;\libusb\include;"
PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;HAVE_USB;HAVE_LIBUSB;HAVE_VME"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="\wxWidgets\include;"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib odbc32.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="\wxWidgets-2.8.10\lib\vc_lib"
GenerateDebugInformation="true"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="0"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="C:\midas\drivers\vme\sis3100\windows;&quot;\wxWidgets-2.8.10\include&quot;;&quot;\wxWidgets-2.8.10\include\msvc&quot;;..\;\mxml;\midas\include;\libusb\include"
PreprocessorDefinitions="WIN32;NDEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;HAVE_USB;HAVE_LIBUSB;HAVE_VME"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib odbc32.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="\wxWidgets-2.8.10\lib\vc_lib"
GenerateDebugInformation="false"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="true"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\AboutDialog.cpp"
>
</File>
<File
RelativePath=".\ConfigDialog.cpp"
>
</File>
<File
RelativePath=".\DisplayDialog.cpp"
>
</File>
<File
RelativePath=".\DOFrame.cpp"
>
</File>
<File
RelativePath=".\DOScreen.cpp"
>
</File>
<File
RelativePath="..\DRS.cpp"
>
</File>
<File
RelativePath=".\DRSOsc.cpp"
>
</File>
<File
RelativePath=".\InfoDialog.cpp"
>
</File>
<File
RelativePath=".\main.cpp"
>
</File>
<File
RelativePath=".\MeasureDialog.cpp"
>
</File>
<File
RelativePath=".\Measurement.cpp"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\drivers\usb\musbstd.c"
>
</File>
<File
RelativePath="..\..\..\..\..\mxml\mxml.c"
>
</File>
<File
RelativePath=".\Osci.cpp"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\drivers\vme\sis3100\sis3100.c"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\drivers\vme\sis3100\windows\sis3100_vme_calls.c"
>
</File>
<File
RelativePath="..\..\..\..\..\mxml\strlcpy.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\AboutDialog.h"
>
</File>
<File
RelativePath=".\ConfigDialog.h"
>
</File>
<File
RelativePath=".\DisplayDialog.h"
>
</File>
<File
RelativePath=".\DOFrame.h"
>
</File>
<File
RelativePath=".\DOScreen.h"
>
</File>
<File
RelativePath="..\DRS.h"
>
</File>
<File
RelativePath=".\DRSOsc.h"
>
</File>
<File
RelativePath=".\DRSOscInc.h"
>
</File>
<File
RelativePath=".\InfoDialog.h"
>
</File>
<File
RelativePath=".\MeasureDialog.h"
>
</File>
<File
RelativePath=".\Measurement.h"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\include\musbstd.h"
>
</File>
<File
RelativePath=".\Osci.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\drsosc.fbp"
>
</File>
<File
RelativePath=".\drsosc.ico"
>
</File>
<File
RelativePath=".\drsosc.rc"
>
</File>
<File
RelativePath="..\..\..\..\..\libusb\lib\msvc\libusb.lib"
>
</File>
<File
RelativePath="..\..\..\..\..\midas\NT\lib\sis1100w.lib"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+153
View File
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{668C949B-D0A7-4CCC-BC8F-5F8731DFBCD1}</ProjectGuid>
<RootNamespace>drsosc</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</EmbedManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\;\wxWidgets-3.0.2\include;\wxWidgets-3.0.2\include\msvc;\mxml;\midas\include;\meg\online\drivers\drs\libusb\include;\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH;HAVE_USB;HAVE_LIBUSB10;USE_DRS_MUTEX;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<BrowseInformation>true</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>\wxWidgets\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
<AdditionalDependencies>wxmsw30ud_adv.lib;wxmsw30ud_core.lib;wxbase30ud.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;wxregexud.lib;wxexpatd.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;libusb-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>\libusb-1.0\MS32\static\;\wxWidgets-3.0.2\lib\vc_lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>LIBCMTD</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>\wxWidgets-3.0.2\include;\wxWidgets-3.0.2\include\msvc;..\;\mxml;\midas\include;\libusb-1.0;\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;__WXMSW__;__WXDEBUG__;_UNICODE;_WINDOWS;NOPCH;HAVE_USB;HAVE_LIBUSB10;USE_DRS_MUTEX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>wxmsw30u_core.lib;wxmsw30u_adv.lib;wxbase30u.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;wxregexu.lib;wxexpat.lib;winmm.lib;comctl32.lib;rpcrt4.lib;wsock32.lib;odbc32.lib;libusb-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>\libusb-1.0\MS32\static;\wxWidgets-3.0.2\lib\vc_lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>LIBCMT</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\averager.cpp" />
<ClCompile Include="AboutDialog.cpp" />
<ClCompile Include="ConfigDialog.cpp" />
<ClCompile Include="DisplayDialog.cpp" />
<ClCompile Include="DOFrame.cpp" />
<ClCompile Include="DOScreen.cpp" />
<ClCompile Include="..\DRS.cpp" />
<ClCompile Include="DRSOsc.cpp" />
<ClCompile Include="EPThread.cpp" />
<ClCompile Include="InfoDialog.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="MeasureDialog.cpp" />
<ClCompile Include="Measurement.cpp" />
<ClCompile Include="..\..\..\..\..\midas\drivers\usb\musbstd.c" />
<ClCompile Include="..\..\..\..\..\mxml\mxml.c" />
<ClCompile Include="Osci.cpp" />
<ClCompile Include="..\..\..\..\..\mxml\strlcpy.c" />
<ClCompile Include="rb.cpp" />
<ClCompile Include="TriggerDialog.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\averager.h" />
<ClInclude Include="AboutDialog.h" />
<ClInclude Include="ConfigDialog.h" />
<ClInclude Include="DisplayDialog.h" />
<ClInclude Include="DOFrame.h" />
<ClInclude Include="DOScreen.h" />
<ClInclude Include="..\DRS.h" />
<ClInclude Include="DRSOsc.h" />
<ClInclude Include="DRSOscInc.h" />
<ClInclude Include="EPThread.h" />
<ClInclude Include="InfoDialog.h" />
<ClInclude Include="MeasureDialog.h" />
<ClInclude Include="Measurement.h" />
<ClInclude Include="..\..\..\..\..\midas\include\musbstd.h" />
<ClInclude Include="Osci.h" />
<ClInclude Include="TriggerDialog.h" />
</ItemGroup>
<ItemGroup>
<None Include="drsosc.fbp" />
<None Include="drsosc.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="drsosc.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+139
View File
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="AboutDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ConfigDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DisplayDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DOFrame.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DOScreen.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\DRS.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DRSOsc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="InfoDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="MeasureDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Measurement.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\midas\drivers\usb\musbstd.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\mxml\mxml.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Osci.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\mxml\strlcpy.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="rb.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="EPThread.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TriggerDialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\averager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="AboutDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ConfigDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DisplayDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DOFrame.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DOScreen.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\DRS.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DRSOsc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DRSOscInc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="InfoDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="MeasureDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Measurement.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\midas\include\musbstd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Osci.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="EPThread.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TriggerDialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\averager.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="drsosc.fbp">
<Filter>Resource Files</Filter>
</None>
<None Include="drsosc.ico">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="drsosc.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>11B26</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>DRSOsc</string>
<key>CFBundleIconFile</key>
<string>DRSOsc.icns</string>
<key>CFBundleIdentifier</key>
<string>PSI.DRSOsc</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>DRSOsc</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>4B110</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>11A511a</string>
<key>DTSDKName</key>
<string>macosx10.7</string>
<key>DTXcode</key>
<string>0410</string>
<key>DTXcodeBuild</key>
<string>4B110</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2011 PSI. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>GNU General Public License</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'drsosc' target in the 'drsosc' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
@@ -0,0 +1,555 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
D510F9F91427842C008644A1 /* musbstd.c in Sources */ = {isa = PBXBuildFile; fileRef = D510F9F81427842C008644A1 /* musbstd.c */; };
D520B6D91427851E00EFBFBE /* DRS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D520B6D81427851E00EFBFBE /* DRS.cpp */; };
D520B6DC1427855B00EFBFBE /* mxml.c in Sources */ = {isa = PBXBuildFile; fileRef = D520B6DA1427855B00EFBFBE /* mxml.c */; };
D520B6DD1427855B00EFBFBE /* strlcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = D520B6DB1427855B00EFBFBE /* strlcpy.c */; };
D5275EBA1844DAA00083CE6A /* averager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5275EB91844DAA00083CE6A /* averager.cpp */; };
D54FC057142777CE00A7A6B0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D54FC056142777CE00A7A6B0 /* Cocoa.framework */; };
D56D7EDE14585114000C7727 /* drsosc.fbp in Resources */ = {isa = PBXBuildFile; fileRef = D56D7EDD14585114000C7727 /* drsosc.fbp */; };
D593C9E8142779F4006744E6 /* AboutDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9D9142779F4006744E6 /* AboutDialog.cpp */; };
D593C9E9142779F4006744E6 /* ConfigDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9DA142779F4006744E6 /* ConfigDialog.cpp */; };
D593C9EA142779F4006744E6 /* DisplayDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9DB142779F4006744E6 /* DisplayDialog.cpp */; };
D593C9EB142779F4006744E6 /* DOFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9DC142779F4006744E6 /* DOFrame.cpp */; };
D593C9EC142779F4006744E6 /* DOScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9DD142779F4006744E6 /* DOScreen.cpp */; };
D593C9EE142779F4006744E6 /* DRSOsc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9DF142779F4006744E6 /* DRSOsc.cpp */; };
D593C9EF142779F4006744E6 /* EPThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E0142779F4006744E6 /* EPThread.cpp */; };
D593C9F0142779F4006744E6 /* InfoDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E1142779F4006744E6 /* InfoDialog.cpp */; };
D593C9F1142779F4006744E6 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E2142779F4006744E6 /* main.cpp */; };
D593C9F2142779F4006744E6 /* MeasureDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E3142779F4006744E6 /* MeasureDialog.cpp */; };
D593C9F3142779F4006744E6 /* Measurement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E4142779F4006744E6 /* Measurement.cpp */; };
D593C9F4142779F4006744E6 /* Osci.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E5142779F4006744E6 /* Osci.cpp */; };
D593C9F5142779F4006744E6 /* rb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E6142779F4006744E6 /* rb.cpp */; };
D593C9F6142779F4006744E6 /* TriggerDialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D593C9E7142779F4006744E6 /* TriggerDialog.cpp */; };
D5D12D7516691F77000AA21F /* DRSOsc.icns in Resources */ = {isa = PBXBuildFile; fileRef = D5D12D7416691F77000AA21F /* DRSOsc.icns */; };
D5E513C3188EB93A00F103E1 /* Icons.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D5E513C2188EB93A00F103E1 /* Icons.xcassets */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
D510F9EF14277B66008644A1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = drsosc.xcodeproj/Info.plist; sourceTree = SOURCE_ROOT; };
D510F9F114277B78008644A1 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prefix.pch; path = drsosc.xcodeproj/Prefix.pch; sourceTree = SOURCE_ROOT; };
D510F9F81427842C008644A1 /* musbstd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = musbstd.c; path = /drs4eb/software/src/musbstd.c; sourceTree = "<absolute>"; };
D520B6D81427851E00EFBFBE /* DRS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DRS.cpp; path = /drs4eb/software/src/DRS.cpp; sourceTree = "<group>"; };
D520B6DA1427855B00EFBFBE /* mxml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mxml.c; path = /drs4eb/software/src/mxml.c; sourceTree = "<absolute>"; };
D520B6DB1427855B00EFBFBE /* strlcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strlcpy.c; path = /drs4eb/software/src/strlcpy.c; sourceTree = "<absolute>"; };
D5275EB81844DA8C0083CE6A /* averager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = averager.h; path = /drs4eb/software/include/averager.h; sourceTree = "<group>"; };
D5275EB91844DAA00083CE6A /* averager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = averager.cpp; path = /drs4eb/software/src/averager.cpp; sourceTree = "<group>"; };
D54FC052142777CE00A7A6B0 /* DRSOsc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DRSOsc.app; sourceTree = BUILT_PRODUCTS_DIR; };
D54FC056142777CE00A7A6B0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
D54FC059142777CE00A7A6B0 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
D54FC05A142777CE00A7A6B0 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
D54FC05B142777CE00A7A6B0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
D56D7EDD14585114000C7727 /* drsosc.fbp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = drsosc.fbp; sourceTree = "<group>"; };
D57C757018B3AD2A002AD084 /* DRSOsc.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = DRSOsc.entitlements; sourceTree = "<group>"; };
D593C9D8142779BC006744E6 /* DRS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DRS.h; path = /drs4eb/software/include/DRS.h; sourceTree = "<group>"; };
D593C9D9142779F4006744E6 /* AboutDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AboutDialog.cpp; sourceTree = SOURCE_ROOT; };
D593C9DA142779F4006744E6 /* ConfigDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConfigDialog.cpp; sourceTree = SOURCE_ROOT; };
D593C9DB142779F4006744E6 /* DisplayDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisplayDialog.cpp; sourceTree = SOURCE_ROOT; };
D593C9DC142779F4006744E6 /* DOFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOFrame.cpp; sourceTree = SOURCE_ROOT; };
D593C9DD142779F4006744E6 /* DOScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOScreen.cpp; sourceTree = SOURCE_ROOT; };
D593C9DF142779F4006744E6 /* DRSOsc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DRSOsc.cpp; sourceTree = SOURCE_ROOT; };
D593C9E0142779F4006744E6 /* EPThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EPThread.cpp; sourceTree = SOURCE_ROOT; };
D593C9E1142779F4006744E6 /* InfoDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InfoDialog.cpp; sourceTree = SOURCE_ROOT; };
D593C9E2142779F4006744E6 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = SOURCE_ROOT; };
D593C9E3142779F4006744E6 /* MeasureDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MeasureDialog.cpp; sourceTree = SOURCE_ROOT; };
D593C9E4142779F4006744E6 /* Measurement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Measurement.cpp; sourceTree = SOURCE_ROOT; };
D593C9E5142779F4006744E6 /* Osci.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Osci.cpp; sourceTree = SOURCE_ROOT; };
D593C9E6142779F4006744E6 /* rb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rb.cpp; sourceTree = SOURCE_ROOT; };
D593C9E7142779F4006744E6 /* TriggerDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TriggerDialog.cpp; sourceTree = SOURCE_ROOT; };
D593C9F714277A1F006744E6 /* AboutDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutDialog.h; sourceTree = "<group>"; };
D593C9F814277A1F006744E6 /* ConfigDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigDialog.h; sourceTree = "<group>"; };
D593C9F914277A1F006744E6 /* DisplayDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayDialog.h; sourceTree = "<group>"; };
D593C9FA14277A1F006744E6 /* DOFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOFrame.h; sourceTree = "<group>"; };
D593C9FB14277A1F006744E6 /* DOScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOScreen.h; sourceTree = "<group>"; };
D593C9FC14277A1F006744E6 /* DRSOsc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRSOsc.h; sourceTree = "<group>"; };
D593C9FD14277A1F006744E6 /* DRSOscInc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DRSOscInc.h; sourceTree = "<group>"; };
D593C9FE14277A1F006744E6 /* EPThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EPThread.h; sourceTree = "<group>"; };
D593C9FF14277A1F006744E6 /* InfoDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InfoDialog.h; sourceTree = "<group>"; };
D593CA0014277A1F006744E6 /* MeasureDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MeasureDialog.h; sourceTree = "<group>"; };
D593CA0114277A1F006744E6 /* Measurement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Measurement.h; sourceTree = "<group>"; };
D593CA0214277A1F006744E6 /* Osci.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Osci.h; sourceTree = "<group>"; };
D593CA0314277A1F006744E6 /* rb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rb.h; sourceTree = "<group>"; };
D593CA0414277A1F006744E6 /* TriggerDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriggerDialog.h; sourceTree = "<group>"; };
D593CA0914277A3C006744E6 /* mxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mxml.h; path = /drs4eb/software/include/mxml.h; sourceTree = "<absolute>"; };
D593CA0A14277A3C006744E6 /* strlcpy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strlcpy.h; path = /drs4eb/software/include/strlcpy.h; sourceTree = "<absolute>"; };
D593CA0B14277A46006744E6 /* musbstd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = musbstd.h; path = /drs4eb/software/include/musbstd.h; sourceTree = "<absolute>"; };
D5D12D7416691F77000AA21F /* DRSOsc.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = DRSOsc.icns; path = /drs4eb/software/drsosc/DRSOsc.icns; sourceTree = "<absolute>"; };
D5E513C2188EB93A00F103E1 /* Icons.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Icons.xcassets; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D54FC04F142777CE00A7A6B0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D54FC057142777CE00A7A6B0 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
D520B6D6142784FD00EFBFBE /* Source files */ = {
isa = PBXGroup;
children = (
D5275EB91844DAA00083CE6A /* averager.cpp */,
D520B6DA1427855B00EFBFBE /* mxml.c */,
D520B6DB1427855B00EFBFBE /* strlcpy.c */,
D520B6D81427851E00EFBFBE /* DRS.cpp */,
D510F9F81427842C008644A1 /* musbstd.c */,
);
name = "Source files";
sourceTree = "<group>";
};
D54FC047142777CD00A7A6B0 = {
isa = PBXGroup;
children = (
D57C757018B3AD2A002AD084 /* DRSOsc.entitlements */,
D5E513C2188EB93A00F103E1 /* Icons.xcassets */,
D56D7EDB145850EB000C7727 /* Resource files */,
D520B6D6142784FD00EFBFBE /* Source files */,
D593C9D7142779A9006744E6 /* Header files */,
D54FC05C142777CE00A7A6B0 /* drsosc */,
D54FC055142777CE00A7A6B0 /* Frameworks */,
D54FC053142777CE00A7A6B0 /* Products */,
);
sourceTree = "<group>";
};
D54FC053142777CE00A7A6B0 /* Products */ = {
isa = PBXGroup;
children = (
D54FC052142777CE00A7A6B0 /* DRSOsc.app */,
);
name = Products;
sourceTree = "<group>";
};
D54FC055142777CE00A7A6B0 /* Frameworks */ = {
isa = PBXGroup;
children = (
D54FC056142777CE00A7A6B0 /* Cocoa.framework */,
D54FC058142777CE00A7A6B0 /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
D54FC058142777CE00A7A6B0 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
D54FC059142777CE00A7A6B0 /* AppKit.framework */,
D54FC05A142777CE00A7A6B0 /* CoreData.framework */,
D54FC05B142777CE00A7A6B0 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
D54FC05C142777CE00A7A6B0 /* drsosc */ = {
isa = PBXGroup;
children = (
D593C9D9142779F4006744E6 /* AboutDialog.cpp */,
D593C9DA142779F4006744E6 /* ConfigDialog.cpp */,
D593C9DB142779F4006744E6 /* DisplayDialog.cpp */,
D593C9DC142779F4006744E6 /* DOFrame.cpp */,
D593C9DD142779F4006744E6 /* DOScreen.cpp */,
D593C9DF142779F4006744E6 /* DRSOsc.cpp */,
D593C9E0142779F4006744E6 /* EPThread.cpp */,
D593C9E1142779F4006744E6 /* InfoDialog.cpp */,
D593C9E2142779F4006744E6 /* main.cpp */,
D593C9E3142779F4006744E6 /* MeasureDialog.cpp */,
D593C9E4142779F4006744E6 /* Measurement.cpp */,
D593C9E5142779F4006744E6 /* Osci.cpp */,
D593C9E6142779F4006744E6 /* rb.cpp */,
D593C9E7142779F4006744E6 /* TriggerDialog.cpp */,
D54FC05D142777CE00A7A6B0 /* Supporting Files */,
);
path = drsosc;
sourceTree = "<group>";
};
D54FC05D142777CE00A7A6B0 /* Supporting Files */ = {
isa = PBXGroup;
children = (
D5D12D7416691F77000AA21F /* DRSOsc.icns */,
D510F9F114277B78008644A1 /* Prefix.pch */,
D510F9EF14277B66008644A1 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
D56D7EDB145850EB000C7727 /* Resource files */ = {
isa = PBXGroup;
children = (
D56D7EDD14585114000C7727 /* drsosc.fbp */,
);
name = "Resource files";
sourceTree = "<group>";
};
D593C9D7142779A9006744E6 /* Header files */ = {
isa = PBXGroup;
children = (
D5275EB81844DA8C0083CE6A /* averager.h */,
D593CA0B14277A46006744E6 /* musbstd.h */,
D593CA0914277A3C006744E6 /* mxml.h */,
D593CA0A14277A3C006744E6 /* strlcpy.h */,
D593C9F714277A1F006744E6 /* AboutDialog.h */,
D593C9F814277A1F006744E6 /* ConfigDialog.h */,
D593C9F914277A1F006744E6 /* DisplayDialog.h */,
D593C9FA14277A1F006744E6 /* DOFrame.h */,
D593C9FB14277A1F006744E6 /* DOScreen.h */,
D593C9FC14277A1F006744E6 /* DRSOsc.h */,
D593C9FD14277A1F006744E6 /* DRSOscInc.h */,
D593C9FE14277A1F006744E6 /* EPThread.h */,
D593C9FF14277A1F006744E6 /* InfoDialog.h */,
D593CA0014277A1F006744E6 /* MeasureDialog.h */,
D593CA0114277A1F006744E6 /* Measurement.h */,
D593CA0214277A1F006744E6 /* Osci.h */,
D593CA0314277A1F006744E6 /* rb.h */,
D593CA0414277A1F006744E6 /* TriggerDialog.h */,
D593C9D8142779BC006744E6 /* DRS.h */,
);
name = "Header files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D54FC051142777CE00A7A6B0 /* DRSOsc */ = {
isa = PBXNativeTarget;
buildConfigurationList = D54FC070142777CE00A7A6B0 /* Build configuration list for PBXNativeTarget "DRSOsc" */;
buildPhases = (
D54FC04E142777CE00A7A6B0 /* Sources */,
D54FC04F142777CE00A7A6B0 /* Frameworks */,
D54FC050142777CE00A7A6B0 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = DRSOsc;
productName = DRSOsc;
productReference = D54FC052142777CE00A7A6B0 /* DRSOsc.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D54FC049142777CD00A7A6B0 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = PSI;
TargetAttributes = {
D54FC051142777CE00A7A6B0 = {
DevelopmentTeam = YMN55GDSJB;
SystemCapabilities = {
com.apple.Sandbox = {
enabled = 0;
};
};
};
};
};
buildConfigurationList = D54FC04C142777CD00A7A6B0 /* Build configuration list for PBXProject "drsosc" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = D54FC047142777CD00A7A6B0;
productRefGroup = D54FC053142777CE00A7A6B0 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D54FC051142777CE00A7A6B0 /* DRSOsc */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
D54FC050142777CE00A7A6B0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D56D7EDE14585114000C7727 /* drsosc.fbp in Resources */,
D5E513C3188EB93A00F103E1 /* Icons.xcassets in Resources */,
D5D12D7516691F77000AA21F /* DRSOsc.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
D54FC04E142777CE00A7A6B0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D593C9E8142779F4006744E6 /* AboutDialog.cpp in Sources */,
D593C9E9142779F4006744E6 /* ConfigDialog.cpp in Sources */,
D593C9EA142779F4006744E6 /* DisplayDialog.cpp in Sources */,
D593C9EB142779F4006744E6 /* DOFrame.cpp in Sources */,
D593C9EC142779F4006744E6 /* DOScreen.cpp in Sources */,
D593C9EE142779F4006744E6 /* DRSOsc.cpp in Sources */,
D593C9EF142779F4006744E6 /* EPThread.cpp in Sources */,
D593C9F0142779F4006744E6 /* InfoDialog.cpp in Sources */,
D593C9F1142779F4006744E6 /* main.cpp in Sources */,
D593C9F2142779F4006744E6 /* MeasureDialog.cpp in Sources */,
D5275EBA1844DAA00083CE6A /* averager.cpp in Sources */,
D593C9F3142779F4006744E6 /* Measurement.cpp in Sources */,
D593C9F4142779F4006744E6 /* Osci.cpp in Sources */,
D593C9F5142779F4006744E6 /* rb.cpp in Sources */,
D593C9F6142779F4006744E6 /* TriggerDialog.cpp in Sources */,
D510F9F91427842C008644A1 /* musbstd.c in Sources */,
D520B6D91427851E00EFBFBE /* DRS.cpp in Sources */,
D520B6DC1427855B00EFBFBE /* mxml.c in Sources */,
D520B6DD1427855B00EFBFBE /* strlcpy.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
D54FC06E142777CE00A7A6B0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = /usr/local/include;
MACOSX_DEPLOYMENT_TARGET = 10.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
D54FC06F142777CE00A7A6B0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = /usr/local/include;
MACOSX_DEPLOYMENT_TARGET = 10.8;
SDKROOT = macosx;
};
name = Release;
};
D54FC071142777CE00A7A6B0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_CXX_LIBRARY = "compiler-default";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = drsosc.xcodeproj/Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = (
OS_DARWIN,
HAVE_USB,
USE_DRS_MUTEX,
HAVE_LIBUSB10,
__WXOSX_COCOA__,
__WXOSX__,
__WXMAC__,
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/usr/local/include,
"/usr/local/lib/wx/include/osx_cocoa-unicode-static-3.0",
"/usr/local/include/wx-3.0",
"/usr/local/include/libusb-1.0",
/drs4eb/software/include,
);
INFOPLIST_FILE = drsosc.xcodeproj/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"/usr/local/lib/libusb-1.0.a",
"-framework",
IOKit,
"-framework",
Carbon,
"-framework",
Cocoa,
"-framework",
AudioToolbox,
"-framework",
System,
"-framework",
OpenGL,
"/usr/local/lib/libwx_osx_cocoau_xrc-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_html-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_qa-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_adv-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_core-3.0.a",
"/usr/local/lib/libwx_baseu_xml-3.0.a",
"/usr/local/lib/libwx_baseu_net-3.0.a",
"/usr/local/lib/libwx_baseu-3.0.a",
"-framework",
WebKit,
"-lexpat",
"-lwxregexu-3.0",
"-lwxtiff-3.0",
"-lwxjpeg-3.0",
"-lwxpng-3.0",
"-lz",
"-lpthread",
"-liconv",
);
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
D54FC072142777CE00A7A6B0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_CXX_LIBRARY = "compiler-default";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = drsosc.xcodeproj/Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = (
OS_DARWIN,
HAVE_USB,
USE_DRS_MUTEX,
HAVE_LIBUSB10,
__WXOSX_COCOA__,
__WXOSX__,
__WXMAC__,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
HEADER_SEARCH_PATHS = (
/usr/local/include,
"/usr/local/lib/wx/include/osx_cocoa-unicode-static-3.0",
"/usr/local/include/wx-3.0",
"/usr/local/include/libusb-1.0",
/drs4eb/software/include,
);
INFOPLIST_FILE = drsosc.xcodeproj/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.7;
OTHER_LDFLAGS = (
"-L/usr/local/lib",
"/usr/local/lib/libusb-1.0.a",
"-framework",
IOKit,
"-framework",
Carbon,
"-framework",
Cocoa,
"-framework",
AudioToolbox,
"-framework",
System,
"-framework",
OpenGL,
"/usr/local/lib/libwx_osx_cocoau_xrc-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_html-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_qa-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_adv-3.0.a",
"/usr/local/lib/libwx_osx_cocoau_core-3.0.a",
"/usr/local/lib/libwx_baseu_xml-3.0.a",
"/usr/local/lib/libwx_baseu_net-3.0.a",
"/usr/local/lib/libwx_baseu-3.0.a",
"-framework",
WebKit,
"-lexpat",
"-lwxregexu-3.0",
"-lwxtiff-3.0",
"-lwxjpeg-3.0",
"-lwxpng-3.0",
"-lz",
"-lpthread",
"-liconv",
);
PRODUCT_BUNDLE_IDENTIFIER = "$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D54FC04C142777CD00A7A6B0 /* Build configuration list for PBXProject "drsosc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D54FC06E142777CE00A7A6B0 /* Debug */,
D54FC06F142777CE00A7A6B0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D54FC070142777CE00A7A6B0 /* Build configuration list for PBXNativeTarget "DRSOsc" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D54FC071142777CE00A7A6B0 /* Debug */,
D54FC072142777CE00A7A6B0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D54FC049142777CD00A7A6B0 /* Project object */;
}
+691
View File
@@ -0,0 +1,691 @@
/* XPM */
static const char * drsosc_xpm[] = {
"64 64 624 2",
" c None",
". c #DDDDDD",
"+ c #E4E4E4",
"@ c #EBEBEB",
"# c #EFEFEF",
"$ c #ECECEC",
"% c #EAEAEA",
"& c #E9E9E9",
"* c #E7E7E7",
"= c #E6E6E6",
"- c #E5E5E5",
"; c #E3E3E3",
"> c #E2E2E2",
", c #E1E1E1",
"' c #E0E0E0",
") c #DFDFDF",
"! c #DCDCDC",
"~ c #DBDBDB",
"{ c #DADADA",
"] c #D8D8D8",
"^ c #D7D7D7",
"/ c #D6D6D6",
"( c #D5D5D5",
"_ c #D4D4D4",
": c #D3D3D3",
"< c #D2D2D2",
"[ c #D1D1D1",
"} c #D0D0D0",
"| c #CFCFCF",
"1 c #CECECE",
"2 c #CDCDCD",
"3 c #CCCCCC",
"4 c #C6C6C6",
"5 c #C0C0C0",
"6 c #B6B6B6",
"7 c #F4F4F4",
"8 c #F0F0F0",
"9 c #EEEEEE",
"0 c #EDEDED",
"a c #E8E8E8",
"b c #E3E2E2",
"c c #DEDEDE",
"d c #D9D9D9",
"e c #D6D7D7",
"f c #CACACA",
"g c #C8C8C9",
"h c #C9C9C9",
"i c #B2B2B2",
"j c #E7E7E8",
"k c #C2C2C2",
"l c #C1C1C1",
"m c #BFBFBF",
"n c #BEBEBE",
"o c #BDBDBD",
"p c #BCBCBC",
"q c #BABBBB",
"r c #BABABA",
"s c #B9B9B9",
"t c #B7B7B7",
"u c #B5B5B5",
"v c #B4B4B4",
"w c #B3B3B3",
"x c #B1B1B1",
"y c #B0B0B0",
"z c #AEAEAE",
"A c #ACACAC",
"B c #ABABAB",
"C c #ADADAD",
"D c #A8A8A8",
"E c #A7A7A7",
"F c #A5A5A5",
"G c #A4A4A4",
"H c #A3A3A3",
"I c #A0A0A0",
"J c #9E9E9E",
"K c #9D9D9D",
"L c #9C9C9C",
"M c #9B9B9B",
"N c #999999",
"O c #979797",
"P c #969696",
"Q c #949494",
"R c #939393",
"S c #929292",
"T c #919191",
"U c #909090",
"V c #8E8E8E",
"W c #BBBBBB",
"X c #C4C4C4",
"Y c #C3C3C3",
"Z c #BCBCBB",
"` c #959595",
" . c #8D8D8D",
".. c #8C8C8C",
"+. c #8A8A8A",
"@. c #888888",
"#. c #858585",
"$. c #838383",
"%. c #808080",
"&. c #7E7E7E",
"*. c #7C7C7C",
"=. c #797979",
"-. c #777777",
";. c #757575",
">. c #737373",
",. c #707070",
"'. c #6E6E6E",
"). c #6C6C6C",
"!. c #696969",
"~. c #666666",
"{. c #646464",
"]. c #5F5F5F",
"^. c #787878",
"/. c #6B6B6B",
"(. c #575757",
"_. c #565656",
":. c #535353",
"<. c #505050",
"[. c #4D4D4D",
"}. c #4B4B4B",
"|. c #484848",
"1. c #454545",
"2. c #424242",
"3. c #404040",
"4. c #3D3D3D",
"5. c #3A3A3A",
"6. c #373737",
"7. c #343434",
"8. c #303030",
"9. c #2D2D2D",
"0. c #2A2A2A",
"a. c #272727",
"b. c #242424",
"c. c #202020",
"d. c #1E1E1E",
"e. c #1B1B1B",
"f. c #363636",
"g. c #828282",
"h. c #B7B6B6",
"i. c #8F8F8F",
"j. c #8B8B8B",
"k. c #878787",
"l. c #848484",
"m. c #818181",
"n. c #7F7F7F",
"o. c #7B7B7B",
"p. c #767676",
"q. c #747474",
"r. c #717171",
"s. c #6A6A6A",
"t. c #676767",
"u. c #6D6D6D",
"v. c #5C5C5C",
"w. c #5A5A5A",
"x. c #585858",
"y. c #555555",
"z. c #525252",
"A. c #4A4A4A",
"B. c #434343",
"C. c #414141",
"D. c #3F3F3F",
"E. c #3C3C3C",
"F. c #383838",
"G. c #333333",
"H. c #2C2C2C",
"I. c #292929",
"J. c #262626",
"K. c #232323",
"L. c #161616",
"M. c #131313",
"N. c #2E2E2E",
"O. c #868686",
"P. c #7A7A7A",
"Q. c #626262",
"R. c #515151",
"S. c #4C4C4C",
"T. c #494949",
"U. c #474747",
"V. c #444444",
"W. c #3E3E3E",
"X. c #393939",
"Y. c #323232",
"Z. c #282828",
"`. c #252525",
" + c #222222",
".+ c #1C1C1C",
"++ c #191919",
"@+ c #111111",
"#+ c #0E0E0E",
"$+ c #898989",
"%+ c #727272",
"&+ c #5B5B5B",
"*+ c #545454",
"=+ c #4F4F4F",
"-+ c #464646",
";+ c #3B3B3B",
">+ c #313131",
",+ c #2F2F2F",
"'+ c #181818",
")+ c #121212",
"!+ c #0B0B0B",
"~+ c #494948",
"{+ c #AFAFAF",
"]+ c #7D7D7D",
"^+ c #686868",
"/+ c #656565",
"(+ c #616161",
"_+ c #4E4E4E",
":+ c #353535",
"<+ c #2B2B2B",
"[+ c #0F0F0F",
"}+ c #020202",
"|+ c #AAAAAA",
"1+ c #989898",
"2+ c #C7C7C7",
"3+ c #606060",
"4+ c #212121",
"5+ c #1D1D1D",
"6+ c #151515",
"7+ c #040404",
"8+ c #ABACAC",
"9+ c #6F6F6F",
"0+ c #636363",
"a+ c #595959",
"b+ c #3A383B",
"c+ c #363138",
"d+ c #363536",
"e+ c #322E33",
"f+ c #2D292F",
"g+ c #2C2A2D",
"h+ c #1A1A1A",
"i+ c #171717",
"j+ c #101010",
"k+ c #080808",
"l+ c #CBCBCB",
"m+ c #5D5D5D",
"n+ c #403E40",
"o+ c #3C3A3D",
"p+ c #4F843B",
"q+ c #4E8737",
"r+ c #477933",
"s+ c #477C32",
"t+ c #49872E",
"u+ c #3A5D2B",
"v+ c #251E28",
"w+ c #1F1F1F",
"x+ c #141414",
"y+ c #0D0D0D",
"z+ c #070707",
"A+ c #A2A2A2",
"B+ c #403D41",
"C+ c #475B3F",
"D+ c #54943C",
"E+ c #39393A",
"F+ c #353137",
"G+ c #333134",
"H+ c #302D31",
"I+ c #2B242E",
"J+ c #344C2B",
"K+ c #478F27",
"L+ c #232025",
"M+ c #222122",
"N+ c #0C0C0C",
"O+ c #424043",
"P+ c #4B6540",
"Q+ c #4F7D3D",
"R+ c #38313B",
"S+ c #29282A",
"T+ c #242126",
"U+ c #469525",
"V+ c #212021",
"W+ c #1D1D1E",
"X+ c #444344",
"Y+ c #485841",
"Z+ c #51823F",
"`+ c #39343C",
" @ c #201A22",
".@ c #42931F",
"+@ c #1A131C",
"@@ c #AEADAD",
"#@ c #A9A9A9",
"$@ c #599840",
"%@ c #3A333D",
"&@ c #1F211F",
"*@ c #3B821B",
"=@ c #160F19",
"-@ c #060606",
";@ c #5E5E5E",
">@ c #423C44",
",@ c #599541",
"'@ c #3C393E",
")@ c #1C1A1D",
"!@ c #27471A",
"~@ c #294E17",
"{@ c #141215",
"]@ c #090909",
"^@ c #050505",
"/@ c #4B6542",
"(@ c #4A6640",
"_@ c #3C3B3C",
":@ c #160F18",
"<@ c #377F16",
"[@ c #131014",
"}@ c #0A0A0A",
"|@ c #A1A1A1",
"1@ c #403942",
"2@ c #579740",
"3@ c #3B353D",
"4@ c #151415",
"5@ c #317512",
"6@ c #0E0910",
"7@ c #030303",
"8@ c #424042",
"9@ c #507A40",
"0@ c #424D3E",
"a@ c #2C6412",
"b@ c #131B0F",
"c@ c #A0A1A0",
"d@ c #3F3941",
"e@ c #55903F",
"f@ c #3A363C",
"g@ c #0E0811",
"h@ c #30790E",
"i@ c #08030A",
"j@ c #403F41",
"k@ c #4E783F",
"l@ c #404A3D",
"m@ c #3B3A3B",
"n@ c #0E0C0F",
"o@ c #255D0C",
"p@ c #0E180A",
"q@ c #080708",
"r@ c #8D8C8D",
"s@ c #3D363F",
"t@ c #538F3D",
"u@ c #39343A",
"v@ c #09040B",
"w@ c #2A7109",
"x@ c #040006",
"y@ c #3F3D3F",
"z@ c #48653D",
"A@ c #43593B",
"B@ c #383738",
"C@ c #080509",
"D@ c #266809",
"E@ c #050405",
"F@ c #010101",
"G@ c #3F3F3E",
"H@ c #3B363C",
"I@ c #518D3B",
"J@ c #362F38",
"K@ c #0A090A",
"L@ c #090E07",
"M@ c #205C05",
"N@ c #020004",
"O@ c #7C7C7D",
"P@ c #3D433B",
"Q@ c #487538",
"R@ c #353436",
"S@ c #030006",
"T@ c #267105",
"U@ c #000003",
"V@ c #39373A",
"W@ c #4C8139",
"X@ c #353336",
"Y@ c #040204",
"Z@ c #143804",
"`@ c #0F2C02",
" # c #000000",
".# c #352F37",
"+# c #4B8736",
"@# c #332F34",
"## c #226A01",
"$# c #454445",
"%# c #3D5435",
"&# c #3E5B33",
"*# c #313032",
"=# c #000002",
"-# c #206600",
";# c #423F43",
"># c #488233",
",# c #2F2931",
"'# c #091F00",
")# c #103B00",
"!# c #131214",
"~# c #3E3940",
"{# c #468031",
"]# c #2E2B2F",
"^# c #1E6800",
"/# c #4E4D4E",
"(# c #48623F",
"_# c #37502E",
":# c #2C2B2C",
"<# c #175D00",
"[# c #0B050D",
"}# c #4A474B",
"|# c #50883C",
"1# c #29232B",
"2# c #082400",
"3# c #183C0C",
"4# c #323032",
"5# c #575857",
"6# c #767576",
"7# c #48434A",
"8# c #4C7F39",
"9# c #353236",
"0# c #09030C",
"a# c #2D6D15",
"b# c #2D2A2E",
"c# c #545254",
"d# c #859D7D",
"e# c #6D6A6E",
"f# c #605F60",
"g# c #697464",
"h# c #677961",
"i# c #5C5C5D",
"j# c #3D3C3D",
"k# c #313F2C",
"l# c #262526",
"m# c #6B8C5F",
"n# c #3E4B3A",
"o# c #262427",
"p# c #4F7D3E",
"q# c #312E32",
"r# c #040304",
"s# c #1A1A19",
"t# c #575657",
"u# c #4B7C3A",
"v# c #3B393B",
"w# c #2A2B2A",
"x# c #241E26",
"y# c #589343",
"z# c #312D32",
"A# c #565158",
"B# c #4B8438",
"C# c #373138",
"D# c #383938",
"E# c #24321F",
"F# c #49713B",
"G# c #2B292C",
"H# c #1A1919",
"I# c #565457",
"J# c #467436",
"K# c #373B36",
"L# c #1F1D20",
"M# c #316D1D",
"N# c #383539",
"O# c #171818",
"P# c #555455",
"Q# c #333732",
"R# c #447233",
"S# c #323033",
"T# c #1B141E",
"U# c #32741B",
"V# c #060706",
"W# c #2E2930",
"X# c #468231",
"Y# c #2F2A31",
"Z# c #1D1C1D",
"`# c #24361D",
" $ c #264C19",
".$ c #343335",
"+$ c #171617",
"@$ c #535253",
"#$ c #2D2B2D",
"$$ c #3E6B2E",
"%$ c #31382E",
"&$ c #2E2D2E",
"*$ c #1A171B",
"=$ c #30701A",
"-$ c #150F16",
";$ c #141313",
">$ c #3E762B",
",$ c #2A282B",
"'$ c #171119",
")$ c #2F7118",
"!$ c #151116",
"~$ c #181717",
"{$ c #272328",
"]$ c #3E7D29",
"^$ c #261F28",
"/$ c #181618",
"($ c #254E17",
"_$ c #1D2F17",
":$ c #131213",
"<$ c #262527",
"[$ c #2F4626",
"}$ c #315127",
"|$ c #252425",
"1$ c #171817",
"2$ c #150E17",
"3$ c #2E7516",
"4$ c #120B14",
"5$ c #0F100F",
"6$ c #161516",
"7$ c #211A23",
"8$ c #3A7E24",
"9$ c #211B23",
"0$ c #151516",
"a$ c #192615",
"b$ c #245314",
"c$ c #121013",
"d$ c #211F22",
"e$ c #315C21",
"f$ c #263321",
"g$ c #130E14",
"h$ c #2B7113",
"i$ c #0F0911",
"j$ c #10100F",
"k$ c #1C161E",
"l$ c #35791E",
"m$ c #1C171E",
"n$ c #131612",
"o$ c #266211",
"p$ c #0F0C10",
"q$ c #1C191D",
"r$ c #2E621D",
"s$ c #1F271C",
"t$ c #0F0B11",
"u$ c #276B10",
"v$ c #0E0B0F",
"w$ c #0F0E0F",
"x$ c #17111A",
"y$ c #32791A",
"z$ c #181918",
"A$ c #0F0F10",
"B$ c #111510",
"C$ c #24610F",
"D$ c #0C090D",
"E$ c #171518",
"F$ c #265117",
"G$ c #1E3217",
"H$ c #0D060F",
"I$ c #27710D",
"J$ c #0B060C",
"K$ c #111211",
"L$ c #120A15",
"M$ c #307E15",
"N$ c #120914",
"O$ c #0D0C0D",
"P$ c #142B0C",
"Q$ c #1C480C",
"R$ c #0A080A",
"S$ c #162212",
"T$ c #266013",
"U$ c #100C12",
"V$ c #09010C",
"W$ c #28790B",
"X$ c #06000A",
"Y$ c #0A0A09",
"Z$ c #0C0B0B",
"`$ c #3D3E3D",
" % c #0F0B10",
".% c #225610",
"+% c #172B10",
"@% c #0F0D0F",
"#% c #0B0C0B",
"$% c #07000A",
"%% c #236E0A",
"&% c #0A0D09",
"*% c #0E0E0D",
"=% c #0C030F",
"-% c #28750E",
";% c #0F140D",
">% c #090A09",
",% c #080209",
"'% c #1B4D09",
")% c #143109",
"!% c #080608",
"~% c #297B0C",
"{% c #0E160C",
"]% c #0A070B",
"^% c #070009",
"/% c #194908",
"(% c #154106",
"_% c #050006",
":% c #226609",
"<% c #194809",
"[% c #080609",
"}% c #060208",
"|% c #060307",
"1% c #216D07",
"2% c #113206",
"3% c #030005",
"4% c #070109",
"5% c #0F2508",
"6% c #216907",
"7% c #1E6007",
"8% c #1C5B07",
"9% c #1E6206",
"0% c #1E6005",
"a% c #040305",
"b% c #040504",
"c% c #020101",
"d% c #131212",
"e% c #020005",
"f% c #030004",
"g% c #040005",
"h% c #050605",
"i% c #0D0E0D",
"j% c #141415",
"k% c #121312",
"l% c #101111",
"m% c #0A0A0B",
"n% c #030302",
"o% c #020303",
"p% c #000001",
"q% c #0E0D0E",
"r% c #191A1A",
"s% c #1C1B1B",
"t% c #1C1D1C",
"u% c #1E1E1F",
"v% c #222221",
"w% c #232223",
"x% c #222322",
"y% c #242423",
"z% c #212122",
"A% c #1E1E1D",
"B% c #19191A",
"C% c #181817",
"D% c #1C1D1D",
"E% c #1F1F1E",
"F% c #1F1E1F",
"G% c #1A1A1B",
" . + @ # $ @ % & * = - ; ; > , , , ' ) ) . . . . ! ~ { ~ { ] ] ^ ^ ^ / ( _ : : < [ [ } | | 1 2 3 3 4 5 6 ",
" ~ 7 8 9 0 9 # 0 @ @ & a * = = = - - - + + ; ; b > > , > ' ' ) c c c c ! ! ! ~ ~ { { d ] ] e / / ( ( } 3 f g h i ",
" j # $ 9 8 + [ k l 5 m n o p q r s t 6 u v w x y z z A B t C D E F G H I I J K L M N O P P Q R S T U V L W ( 1 X Y Z ",
" + @ % 8 ( D ` V ...+.@.#.$.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c.d.e.c.f.g.3 X n h. ",
" 2 & * % i S T S i.i. ...j.@.k.l.g.m.n.*.o.^.p.q.r.'.).s.t.{.o.u.v.w.x.y.z.<.[.A.|.B.C.D.E.F.f.G.8.H.I.J.K.c.e.L.M.N.A 5 s K ",
" = > & x T S R T i.V ..j.+.@.O.l.g.%.&.*.P.-.;.>.r.'.).!.~.Q.P.u.v.w.x.y.R.<.S.T.U.V.C.W.E.X.f.Y.8.H.Z.`. +c..+++L.@+#+o t 6 ",
"m ' ) 2 T R R T i.i.V ..+.$+k.#.l.m.n.&.o.=.p.q.%+,.'./.!.~.Q.P.).&+w.(.*+R.=+}.|.-+B.C.W.;+6.7.>+,+H.Z.J. +d.e.'+L.)+!+~+p {+$+",
"f ] ' G U T U i.V . .j.$+k.#.#.$.%.&.]+o.^.p.q.r.'.)./.^+/+(+=./.w.x.y.z.<._+A.|.-+2.3.4.;+6.:+>+N.<+Z.`. +d.e.'+L.@+[+}+|+A 1+",
"2+: } R i.i.V . ...j.+.k.O.#.g.m.&.]+o.=.p.;.>.r.'./.!.t.{.3+^./.w.x.y.z.<.[.T.U.1.2.D.E.5.f.G.>+N.0.a.b.4+5+e.'+6+@+#+7+u.8+M ",
"X 1 l .V V ...j.+.$+@.O.l.$.m.n.&.*.P.^.p.>.r.9+u./.^+/+0+3+-.!.a+(.:.R.=+S.|.U.V.C.W.b+c+d+e+f+g+I.J.K.4+5+h+i+6+j+#+k+-+D 1+",
"m l+u +.....j.j.+.@.k.#.l.g.m.%.&.*.P.=.p.q.%+,.u./.!.~.{.Q.m+;.!.(._.z.<._+A.U.-+2.n+o+p+q+r+s+t+u+v+`.K.w+5+++L.x+j+y+z+7.A+R ",
"r 4 x $+j.$+$+@.@.O.O.l.$.m.%.&.]+o.^.-.q.>.r.9+).s.^+/+0+3+&+q.t._.*+R.=+[.T.U.V.B+C+D+E+F+G+H+I+J+K+L+M+d.e.++L.)+[+N+z+>+K V ",
"6 k z O.@.k.O.O.l.l.$.g.m.%.]+*.o.^.-.;.>.%+9+)./.^+~.0+Q.].&+>.~.y.z.<._+}.|.-+O+P+Q+R+6.:+Y.,+9.S+T+U+V+W+h+'+x+)+#+!+z+,+O $+",
"i o B l.#.#.l.l.$.g.m.%.n.]+*.o.=.-.;.%+r.9+u./.^+~./+Q.].m+a+r.{.:.R._+S.T.U.X+Y+Z+`+5.6.G.>+N.<+Z.`. @.@+@h+i+x+@+#+!+z+9.S l.",
"@@s #@m.g.$.g.m.m.n.n.&.*.o.=.^.-.;.>.%+,.u./.!.t./+Q.3+m+v.x.r.Q.R.<.[.}.U.-+O+$@%@;+F.:+Y.8.9.0.J.b.V+&@*@=@L.x+@+y+!+-@<+ .%.",
"#@v E n.%.%.n.n.&.]+*.P.P.=.-.p.q.>.,.9+u.s.^+~./+0+(+;@v.w._.9+3+=+[.S.|.U.>@,@'@;+5.f.G.>+9.H.Z.`.K.4+)@!@~@{@)+[+N+]@^@I.@.P.",
"F {+G *.&.&.]+]+o.o.P.=.^.-.;.>.r.,.'.u.s.!.t./+0+(+m+v.w.(.*+).]._+S.T.U.X+/@(@_@5.6.f.Y.8.9.0.a.b.4+w+e.:@<@[@j+#+}@}@^@Z.$.;.",
"I |+|@=.o.P.P.=.^.^.-.p.q.q.%+,.,.'.)./.!.~.{.0+3+m+v.w.x._.R./.m+S.A.U.V.1@2@3@;+F.f.G.>+9.<+I.`.K.4+d.h+i+4@5@6@N+}@]@7@J.n.r.",
"M F J p.-.^.-.-.p.;.;.q.%+r.9+9+).).!.t./+{.Q.3+m+v.w.x._.*+<.!.&+A.|.1.8@9@0@;+X.6.7.>+N.H.0.J.K. +d..+++i+[@a@b@!+]@k+7@`.=.).",
"O c@L q.;.;.;.q.>.%+r.,.9+'.u./.s.^+t./+0+0+3+m+v.w.x.y.:.R._+t.x.|.-+B.d@e@f@5.6.:+Y.8.9.0.Z.`. +c.5+h+i+x+M.g@h@i@]@-@7@K.q.t.",
"T M N ,.%+r.r.,.,.9+'.'.u./.s.!.t./+{.Q.Q.].m+v.a+(.y.:.z.=+}.{._.-+B.j@k@l@m@6.f.Y.8.9.<+I.`.K.4+d..+++L.x+@+n@o@p@q@^@}+4+9+Q.",
"r@P P u.'.'.'.'.).).).s.s.!.t./+/+0+Q.3+m+v.&+x.(.y.z.R.=+S.|.Q.*+2.C.s@t@u@F.f.G.8.N.H.I.a.b.4+w+5+h+i+6+M.j+#+v@w@x@^@}+w+!.m+",
"k.T R s././././.s.!.!.^+~./+{.0+Q.3+].v.&+w.x._.*+z.R.=+S.A.-+].z.3.y@z@A@B@:+7.Y.N.H.0.Z.`. +c.5+e.'+L.x+)+[+N+C@D@E@7+F@5+0+x.",
"g.j.U ~.^+^+t.t.~./+{.{.{.Q.(+3+;@v.v.w.x.(.y.:.R.<.[.S.T.|.V.;@=+G@H@I@J@f.G.>+,+9.0.Z.J. +4+d..+++L.x+)+j+y+}@K@L@M@N@F@e.].:.",
"O@O. .{.~./+/+{.{.0+Q.(+(+].m+v.v.w.a+x.y.*+z.R._+[.}.|.U.1.C.&+[.;+P@Q@R@7.Y.,+H.<+Z.J.b.4+w+5+h+i+6+M.@+[+N+}@]@S@T@U@F@++w.=+",
"^.m.+.3+Q.(+(+(+3+3+;@m+m+v.&+w.a+x._.y.:.R.<._+[.}.|.U.1.B.D.a+}.V@W@X@7.Y.8.9.<+I.J.b.4+w+5+h+'+i+x+@+j+#+}@]@k+Y@Z@`@ #'+_.}.",
">.*.k.m+].].;@m+m+m+v.v.&+w.a+(._.*+:.R.<._+[.S.T.U.1.1.2.C.4._.|..#+#@#>+8.9.H.I.a.`. +w+d..+++L.x+M.j+#+N+}@]@7+^@U@## #i+<.-+",
").^.l.w.v.&+&+w.w.a+a+x.(._.y.*+z.z.R.=+_+S.}.T.U.-+V.2.3.4.5._.$#%#&#*#8.N.<+I.a.`.K.4+d..+h+'+6+M.@+j+N+}@}@z+^@7@=#-# #6+S.B.",
"3+/.g.(.x.a+x.x.(.(._.y.y.:.z.R.<.=+[.S.}.T.U.-+1.2.C.D.4.E.F.:.;#>#,#8.H.H.I.a.b.K.c.w+.+h+'+L.M.@+[+#+!+]@k+^@7@7@ #'#)#!#-+:+",
"&+{.p.<._.y.y.*+:.:.z.R.R.<.=+=+[.S.A.A.|.-+1.B.2.3.W.E.;+F.:+<.~#{#]#9.<+I.a.`.K.4+d.5+e.'+i+x+)+@+#+!+]@k+-@^@7@}+ # #^#6@X.,+",
"(.].q.U.A.=+z.R.R.R.<.=+_+_+[.}.A.T.|.-+1.V.2.3.3.4.;+;+X.6.G./#(#_#:#<+I.Z.`. +4+w+.+h+++L.x+)+j+[+y+}@]@z+^@7@7@ # # #<#[#f.9.",
"z.w.r.V.-+1.-+}.[.S.S.}.A.T.|.|.-+1.B.2.C.3.D.4.;+5.F.f.:+G.,+}#|#1#0.Z.J.K. +c.5+.+h+++6+M.)+[+#+y+}@]@z+7+7@}+F@ # # #2#3#4#0.",
"R.5#6#}.[.[.S.S.}._+R.:.R.<.=+_+[.S.S.A.T.U.-+V.B.C.3.3.W.E.5.7#8#9#G.Y.8.,+N.<+I.a.`.b. +c.w+5+5+h+'+i+L.x+@+#+#+N+N+N+0#a#b#J.",
"[.c#d#e#'.'.'.'.u.u.).).'.,.r.,.,.9+'.u.)./.s.^+^+t.~.{.0+Q.f#g#h#i#&+&+a+x._.y.:.:.z.<.=+=+[.S.A.T.|.-+2.D.W.W.4.4.4.4.j#k#l#h+",
"6+R@m#n#_@;+;+5.5.X.X.F.F.6.f.f.F.X.X.F.6.:+7.G.>+,+N.H.0.I.o#p#q#4+4+d.5+h+++i+L.M.@+j+y+N+}@z+-@7@ #F@ # # # # # # # # #r#s#x+",
")+6+t#u#v#;+;+;+;+5.5.X.F.6.f.:+7.G.Y.>+Y.Y.Y.>+8.8.,+9.H.w#x#y#z#K. +w+d.5+e.'+i+M.)+j+y+!+]@]@k+^@^@7@7@}+ # # # # # # #z+h+6+",
")+i+A#B#C#D#X.F.6.6.6.f.f.:+7.G.Y.>+>+8.N.H.<+0.Z.a.J.`.b.M+E#F#G#.+e.++'+6+x+M.j+[+#+y+!+}@]@k+^@7+7+}+}+F@ # # # # # # #z+H#6+",
")+i+I#J#K#f.f.:+f.:+7.7.Y.Y.>+>+8.,+N.H.H.0.I.Z.a.`.b. +4+L#M#N#Z.h+'+i+6+x+M.@+[+[+y+N+}@}@k+-@^@7+}+}+F@ # # # # # # # #z+++6+",
")+O#P#Q#R#S#G.Y.Y.Y.>+>+>+8.,+N.9.H.H.0.I.Z.Z.J.`.K. +4+c.T#U#F+a.i+i+6+x+M.j+j+[+y+N+]@}@k+-@^@^@7@7@}+ # # # # # # # # #V#++6+",
"@+i+*+W#X#Y#>+>+8.8.,+N.N.9.H.H.<+I.I.Z.Z.J.`.b. +4+c.d.Z#`# $.$`.L.6+x+)+@+j+[+y+N+]@}@]@-@^@^@7@7@}+ # # # # # # # # # #-@++x+",
"@++$@$#$$$%$&$9.9.9.H.H.<+<+I.I.Z.Z.a.`.b.b. +4+4+w+d.5+*$=$-$G.K.x+x+)+j+[+#+y+N+}@}@]@-@^@^@7@7@}+F@ # # # # # # # # # #-@'+;$",
"@+i+R.0.G#>$,$<+<+0.0.I.Z.Z.Z.a.J.`.b.K.4+4+4+w+d.5+.+h+'$)$!$>+4+M.)+j+[+[+y+N+}@}@]@-@^@^@7@}+}+F@ # # # # # # # # # # #-@~$M.",
"j+i+<.Z.{$]$^$I.Z.Z.Z.a.J.`.`.b.b. + +4+4+w+d.5+.+e.h+/$($_$:$8.c.@+j+[+y+N+N+]@}@]@z+^@^@7@}+}+F@ # # # # # # # # # # # #-@L.M.",
"@+L._+`.<$[$}$|$`.`.`.b.K.K. +4+4+4+c.w+d.5+.+e.h+'+1$2$3$4$)+N.d.[+[+y+N+}@}@}@k+-@^@^@7@}+}+F@ # # # # # # # # # # # # #-@L.M.",
"5$6$[. +K.7$8$9$K. + +4+4+4+4+w+w+d.d.5+e.h+h+'+'+i+0$a$b$c$j+H.e.#+y+N+}@]@}@k+-@^@^@7@}+}+F@ # # # # # # # # # # # # # #-@6+)+",
"[+6+}.c. +d$e$f$V+4+c.c.w+d.d.5+5+.+e.h+h+'+'+i+L.6+g$h$i$@+#+0.h+N+N+}@]@]@k+-@^@^@7@}+}+F@ # # # # # # # # # # # # # # #^@x+@+",
"j$6+A.5+w+d.k$l$m$d.d.5+5+.+e.e.h+h+'+'+i+i+L.6+x+M.n$o$p$[+N+Z.'+}@}@}@]@z+^@7+7+7@7@}+F@ # # # # # # # # # # # # # # # #^@x+@+",
"[+6+T.e..+5+q$r$s$e.e.e.h+h+++'+'+'+i+L.6+x+x+M.)+t$u$v$w$y+!+Z.L.]@]@]@-@^@7+^@7@7@}+F@ # # # # # # # # # # # # # # # # #^@)+j+",
"#+x+|.'+h+h+h+x$y$'$z$'+'+i+i+i+L.6+6+x+x+M.@+@+A$B$C$D$y+N+]@J.6+]@z+-@^@^@7+}+7@}+F@ # # # # # # # # # # # # # # # # # #7+)+j+",
"#+x+-+L.i+i+i+E$F$G$+$i+L.6+6+x+x+x+M.)+@+j+j+[+H$I$J$N+!+}@k+b.x+-@^@7+7+7@}+}+}+ # # # # # # # # # # # # # # # # # # # #7+K$j+",
"y+)+1.M.6+6+6+6+L$M$N$x+x+x+M.)+)+@+j+j+[+[+#+O$P$Q$R$}@]@}@z+ +)+7+^@7+7@7@}+F@ # # # # # # # # # # # # # # # # # # # # #7+@+j+",
"N+)+B.)+x+x+x+x+M.S$T$U$)+@+j+j+[+j+[+#+y+y+N+V$W$X$Y$]@]@z+7+4+j+7+7@}+}+}+ # # # # # # # # # # # # # # # # # # # # # # #7+j$[+",
"Z$@+`$[+@+@+@+j+j+ %.%+%@%j+[+[+#+y+y+N+N+#%$%%%&%]@]@z+-@^@7@c.[+}+7@}+F@ # # # # # # # # # # # # # # # # # # # # # # # #7@[+#+",
"!+*%>+[+[+j+j+[+[+[+=%-%;%O$N+y+N+N+!+}@>%,%'%)%!%z+-@^@7+^@}+w+#+}+}+ # # # # # # # # # # # # # # # # # # # # # # # # # #7+#+y+",
"N+N+K.[+y+y+N+y+y+N+N+V$~%{%]%}@}@]@}@}@^%/%(%_%^@^@7+^@7@7@F@5+y+ # # # # # # # # # # # # # # # # # # # # # # # # # # # #z+N+y+",
"}@}@0$y+!+N+!+!+!+!+}@}@$%:%<%$%C@[%}%|%1%2%3%^@^@7+7+7@7@}+ #5+!+ # # # # # # # # # # # # # # # # # # # # # # # # # # # #}@!+}@",
"k+]@)+N+]@]@]@]@}@}@}@}@]@4%5%6%7%8%9%0%a%Y@b%7@7@}+7@}+}+F@ #.+!+ # # # # # # # # # # # # # # # # # # # # # # # # # # #c%y+}@k+",
"7@}@N+d%k+]@]@]@k+z+z+-@z+-@a%3%e%f%N@g%r#7@}+}+}+}+}+F@ # # #h+}@ # # # # # # # # # # # # # # # # # # # # # # # # # # #]@N+!+7@",
" k+]@)+[+^@-@^@^@^@^@^@^@7+^@^@7+7@7@}+}+7@}+}+F@ # # # # # #h+}@ # # # # # # # # # # # # # # # # # # # # # # # # # #h%i%!+]@ ",
" #!+}@j%k%-@7@7+7+7+7+7@7@7@}+}+}+}+}+}+F@ # # # # # # # # #h+}@ # # # # # # # # # # # # # # # # # # # # # # # #F@}@[+N+N+ # ",
" F@!+}@l%'+M.m%-@7@7@7@7@7@7@7@n%o%7@}+}+}+}+}+}+}+}+}+}+F@6$]@}+}+}+}+}+F@}+F@F@F@F@F@ # # # #p%F@F@ # #F@-@N+j+j+O$q%F@ ",
" #}@y+N+j+6+i+i+'+r%s%.+t%5+u%c.c.v%w%K. +x%K.y%b.b.b.b.v%z%K.K. + + +4+c.c.w+d.A%5+.+e.h+B%C%i+L.6+x+M.)+@+j$#+!+ # ",
" #7@}@#+j+@+)+x+x+L.i+i+i+'+++h+h+.+5+t%D%5+W+E%w+w+w+w+w+w+w+w+w+w+F%d.5+5+5+.+.+G%h+++'+i+'+i+L.x+x+M.j+!+7@ # ",
" # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # "};
+35
View File
@@ -0,0 +1,35 @@
/* XPM */
static const char *left_xpm[]={
"20 28 4 1",
". c None",
"b c #808080",
"a c #c0c0c0",
"# c #ffffff",
"....................",
"...............#a...",
"..............#aabb.",
".............#aaabb.",
"............#aaaabb.",
"...........#aaaaabb.",
"..........#aaaaaabb.",
".........#aaaaaaabb.",
"........#aaaaaaaabb.",
".......#aaaaaaaaabb.",
"......#aaaaaaaaaabb.",
".....#aaaaaaaaaaabb.",
"....#aaaaaaaaaaaabb.",
"...#aaaaaaaaaaaaabb.",
"....aaaaaaaaaaaaabb.",
".....aaaaaaaaaaaabb.",
"......aaaaaaaaaaabb.",
".......aaaaaaaaaabb.",
"........aaaaaaaaabb.",
".........aaaaaaaabb.",
"..........aaaaaaabb.",
"...........aaaaaabb.",
"............aaaaabb.",
".............aaaabb.",
"..............aaabb.",
"...............aabb.",
"................abb.",
".................bb."};
+84
View File
@@ -0,0 +1,84 @@
/********************************************************************
Name: main.c
Created by: Stefan Ritt
Contents: Main wxWidgets application for DRSOsc project
$Id: main.cpp 21437 2014-07-30 14:13:29Z ritt $
\********************************************************************/
#include "DRSOscInc.h"
#include "drsosc.xpm"
class DOApp : public wxApp
{
public:
virtual bool OnInit();
virtual int OnExit();
private:
};
DOApp& wxGetApp();
IMPLEMENT_APP(DOApp)
/*------------------------------------------------------------------*/
/* NaN's */
/*------------------------------------------------------------------*/
#ifdef _MSC_VER
unsigned long _nan[2]={0xffffffff, 0x7fffffff};
#endif
double ss_nan()
{
#ifdef _MSC_VER
return *(double *)_nan;
#else
return nan("");
#endif
}
#ifdef _MSC_VER
#include <float.h>
#ifndef isnan
#define isnan(x) _isnan(x)
#endif
#ifndef finite
#define finite(x) _finite(x)
#endif
#elif defined(__linux__)
#include <math.h>
#endif
int ss_isnan(double x)
{
return isnan(x);
}
void ss_sleep(int ms)
{
wxThread::Sleep(ms);
}
/*------------------------------------------------------------------*/
/* DOApp */
/*------------------------------------------------------------------*/
bool DOApp::OnInit()
{
DOFrame *frame = new DOFrame(NULL);
frame->Show(TRUE);
frame->SetIcon(wxICON(drsosc));
SetTopWindow(frame);
return true;
}
/*------------------------------------------------------------------*/
int DOApp::OnExit()
{
return wxApp::OnExit();
}
+35
View File
@@ -0,0 +1,35 @@
/* XPM */
static const char *neg_xpm[] = {
/* width height num_colors chars_per_pixel */
" 20 20 8 1",
/* colors */
"` c #36349b",
". c #a2a1ba",
"# c #dddfde",
"a c #82818a",
"b c None",
"c c #5959a4",
"d c #babbbd",
"e c #9292a0",
/* pixels */
"bbbbbbbbbbbbbbbbbbbb",
"bbbbbbbbbbbbbbbbbbbb",
"#######bbbbbbbbbbbbb",
"daaaaaa#bbbbbbbbbbbb",
"b#ddddee#bbbbbbbbbbb",
"bb#####adbbbbbbbbbbb",
"bbbbbbb.ac#bbbbbbbbb",
"bbbbbb.c``.bbbbbbbbb",
"bbbbbbe```a#bbbbbbbb",
"bbbbbbb.``c#bbbbbbbb",
"bbbbbbbb.``dbbbbbbbb",
"bbbbbbbbb.`ebbbbbbbb",
"bbbbbbbbbbaa#bbbbbbb",
"bbbbbbbbbb#adbbbbbbb",
"bbbbbbbbbbb.e#####bb",
"bbbbbbbbbbb#aaaaaadb",
"bbbbbbbbbbbbbdddddd#",
"bbbbbbbbbbbbbb######",
"bbbbbbbbbbbbbbbbbbbb",
"bbbbbbbbbbbbbbbbbbbb"
};
+35
View File
@@ -0,0 +1,35 @@
/* XPM */
static const char *pos_xpm[] = {
/* width height num_colors chars_per_pixel */
" 20 20 8 1",
/* colors */
"` c #37369b",
". c #a8a9ab",
"# c #dfdedf",
"a c #c3c3c4",
"b c #7273a4",
"c c #868589",
"d c #5c5ca7",
"e c None",
/* pixels */
"eeeeeeeeeeeeeeeeeeee",
"eeeeeeeeeeeeeeeeeeee",
"eeeeeeeeeeee#######e",
"eeeeeeeeeee#ccccccae",
"eeeeeeeeeee..aaaaaaa",
"eeeeeeeeee#b#a######",
"eeeeeeeeeedca#eeeeee",
"eeeeeeeeed`a.eeeeeee",
"eeeeeeeed``.aeeeeeee",
"eeeeeeed``d.#eeeeeee",
"eeeeeeb```d.eeeeeeee",
"eeeeeee.``baeeeeeeee",
"eeeeeee..c.#eeeeeeee",
"eeeeee#c#a##eeeeeeee",
"e#####..a#eeeeeeeeee",
".cccccc#aeeeeeeeeeee",
"e#....aa#eeeeeeeeeee",
"ee######eeeeeeeeeeee",
"eeeeeeeeeeeeeeeeeeee",
"eeeeeeeeeeeeeeeeeeee"
};
+387
View File
@@ -0,0 +1,387 @@
/********************************************************************\
Name: rb.c
Created by: Stefan Ritt
$Id: rb.cpp 21437 2014-07-30 14:13:29Z ritt $
\********************************************************************/
#include <stdio.h>
#ifdef OS_DARWIN
#include <sys/malloc.h>
#else
#include <malloc.h>
#endif
#include <string.h>
#include <assert.h>
#include "rb.h"
/********************************************************************\
* *
* Ring buffer functions *
* *
* Provide an inter-thread buffer scheme for handling front-end *
* events. This code allows concurrent data acquisition, calibration *
* and network transfer on a multi-CPU machine. One thread reads *
* out the data, passes it vis the ring buffer functions *
* to another thread running on the other CPU, which can then *
* calibrate and/or send the data over the network. *
* *
\********************************************************************/
typedef struct {
unsigned char *buffer;
unsigned int size;
unsigned int max_event_size;
unsigned char *rp;
unsigned char *wp;
unsigned char *ep;
} RING_BUFFER;
#define MAX_RING_BUFFER 100
RING_BUFFER rb[MAX_RING_BUFFER];
volatile int _rb_nonblocking = 0;
extern void ss_sleep(int ms);
int rb_set_nonblocking()
/********************************************************************\
Routine: rb_set_nonblocking
Purpose: Set all rb_get_xx to nonblocking. Needed in multi-thread
environments for stopping all theads without deadlock
Input:
NONE
Output:
NONE
Function value:
RB_SUCCESS Successful completion
\********************************************************************/
{
_rb_nonblocking = 1;
return RB_SUCCESS;
}
int rb_create(int size, int max_event_size, int *handle)
/********************************************************************\
Routine: rb_create
Purpose: Create a ring buffer with a given size
Input:
int size Size of ring buffer, must be larger than
2*max_event_size
int max_event_size Maximum event size to be placed into
ring buffer
Output:
int *handle Handle to ring buffer
Function value:
DB_SUCCESS Successful completion
DB_NO_MEMORY Maximum number of ring buffers exceeded
DB_INVALID_PARAM Invalid event size specified
\********************************************************************/
{
int i;
for (i = 0; i < MAX_RING_BUFFER; i++)
if (rb[i].buffer == NULL)
break;
if (i == MAX_RING_BUFFER)
return RB_NO_MEMORY;
if (size < max_event_size * 2)
return RB_INVALID_PARAM;
memset(&rb[i], 0, sizeof(RING_BUFFER));
rb[i].buffer = (unsigned char *) malloc(size);
assert(rb[i].buffer);
rb[i].size = size;
rb[i].max_event_size = max_event_size;
rb[i].rp = rb[i].buffer;
rb[i].wp = rb[i].buffer;
rb[i].ep = rb[i].buffer;
*handle = i + 1;
return RB_SUCCESS;
}
int rb_delete(int handle)
/********************************************************************\
Routine: rb_delete
Purpose: Delete a ring buffer
Input:
none
Output:
int handle Handle to ring buffer
Function value:
DB_SUCCESS Successful completion
\********************************************************************/
{
if (handle < 0 || handle >= MAX_RING_BUFFER || rb[handle - 1].buffer == NULL)
return RB_INVALID_HANDLE;
free(rb[handle - 1].buffer);
memset(&rb[handle - 1], 0, sizeof(RING_BUFFER));
return RB_SUCCESS;
}
int rb_get_wp(int handle, void **p, int millisec)
/********************************************************************\
Routine: rb_get_wp
Purpose: Retrieve write pointer where new data can be written
Input:
int handle Ring buffer handle
int millisec Optional timeout in milliseconds if
buffer is full. Zero to not wait at
all (non-blocking)
Output:
char **p Write pointer
Function value:
DB_SUCCESS Successful completion
\********************************************************************/
{
int h, i;
unsigned char *rp;
if (handle < 1 || handle > MAX_RING_BUFFER || rb[handle - 1].buffer == NULL)
return RB_INVALID_HANDLE;
h = handle - 1;
for (i = 0; i <= millisec / 10; i++) {
rp = rb[h].rp; // keep local copy, rb[h].rp might be changed by other thread
/* check if enough size for wp >= rp without wrap-around */
if (rb[h].wp >= rp
&& rb[h].wp + rb[h].max_event_size <= rb[h].buffer + rb[h].size - rb[h].max_event_size) {
*p = rb[h].wp;
return RB_SUCCESS;
}
/* check if enough size for wp >= rp with wrap-around */
if (rb[h].wp >= rp && rb[h].wp + rb[h].max_event_size > rb[h].buffer + rb[h].size - rb[h].max_event_size && rb[h].rp > rb[h].buffer) { // next increment of wp wraps around, so need space at beginning
*p = rb[h].wp;
return RB_SUCCESS;
}
/* check if enough size for wp < rp */
if (rb[h].wp < rp && rb[h].wp + rb[h].max_event_size < rp) {
*p = rb[h].wp;
return RB_SUCCESS;
}
if (millisec == 0)
return RB_TIMEOUT;
if (_rb_nonblocking)
return RB_TIMEOUT;
/* wait one time slice */
ss_sleep(10);
}
return RB_TIMEOUT;
}
int rb_increment_wp(int handle, int size)
/********************************************************************\
Routine: rb_increment_wp
Purpose: Increment current write pointer, making the data at
the write pointer available to the receiving thread
Input:
int handle Ring buffer handle
int size Number of bytes placed at the WP
Output:
NONE
Function value:
RB_SUCCESS Successful completion
RB_INVALID_PARAM Event size too large or invalid handle
\********************************************************************/
{
int h;
unsigned char *new_wp;
if (handle < 1 || handle > MAX_RING_BUFFER || rb[handle - 1].buffer == NULL)
return RB_INVALID_HANDLE;
h = handle - 1;
if ((unsigned int) size > rb[h].max_event_size)
return RB_INVALID_PARAM;
new_wp = rb[h].wp + size;
/* wrap around wp if not enough space */
if (new_wp > rb[h].buffer + rb[h].size - rb[h].max_event_size) {
rb[h].ep = new_wp;
new_wp = rb[h].buffer;
assert(rb[h].rp != rb[h].buffer);
}
rb[h].wp = new_wp;
return RB_SUCCESS;
}
int rb_get_rp(int handle, void **p, int millisec)
/********************************************************************\
Routine: rb_get_rp
Purpose: Obtain the current read pointer at which new data is
available with optional timeout
Input:
int handle Ring buffer handle
int millisec Optional timeout in milliseconds if
buffer is full. Zero to not wait at
all (non-blocking)
Output:
char **p Address of pointer pointing to newly
available data. If p == NULL, only
return status.
Function value:
RB_SUCCESS Successful completion
\********************************************************************/
{
int i, h;
if (handle < 1 || handle > MAX_RING_BUFFER || rb[handle - 1].buffer == NULL)
return RB_INVALID_HANDLE;
h = handle - 1;
for (i = 0; i <= millisec / 10; i++) {
if (rb[h].wp != rb[h].rp) {
if (p != NULL)
*p = rb[handle - 1].rp;
return RB_SUCCESS;
}
if (millisec == 0)
return RB_TIMEOUT;
if (_rb_nonblocking)
return RB_TIMEOUT;
/* wait one time slice */
ss_sleep(10);
}
return RB_TIMEOUT;
}
int rb_increment_rp(int handle, int size)
/********************************************************************\
Routine: rb_increment_rp
Purpose: Increment current read pointer, freeing up space for
the writing thread.
Input:
int handle Ring buffer handle
int size Number of bytes to free up at current
read pointer
Output:
NONE
Function value:
RB_SUCCESS Successful completion
RB_INVALID_PARAM Event size too large or invalid handle
\********************************************************************/
{
int h;
unsigned char *new_rp;
if (handle < 1 || handle > MAX_RING_BUFFER || rb[handle - 1].buffer == NULL)
return RB_INVALID_HANDLE;
h = handle - 1;
if ((unsigned int) size > rb[h].max_event_size)
return RB_INVALID_PARAM;
new_rp = rb[h].rp + size;
/* wrap around if not enough space left */
if (new_rp + rb[h].max_event_size > rb[h].buffer + rb[h].size)
new_rp = rb[h].buffer;
rb[handle - 1].rp = new_rp;
return RB_SUCCESS;
}
int rb_get_buffer_level(int handle, int *n_bytes)
/********************************************************************\
Routine: rb_get_buffer_level
Purpose: Return number of bytes in a ring buffer
Input:
int handle Handle of the buffer to get the info
Output:
int *n_bytes Number of bytes in buffer
Function value:
RB_SUCCESS Successful completion
RB_INVALID_HANDLE Buffer handle is invalid
\********************************************************************/
{
int h;
if (handle < 1 || handle > MAX_RING_BUFFER || rb[handle - 1].buffer == NULL)
return RB_INVALID_HANDLE;
h = handle - 1;
if (rb[h].wp >= rb[h].rp)
*n_bytes = rb[h].wp - rb[h].rp;
else
*n_bytes = rb[h].ep - rb[h].rp + rb[h].wp - rb[h].buffer;
return RB_SUCCESS;
}
+28
View File
@@ -0,0 +1,28 @@
/********************************************************************\
Name: rb.h
Created by: Stefan Ritt
Contents: Function declarations and constants for ring buffer
routines
$Id: rb.h 17217 2011-02-25 15:31:29Z ritt $
\********************************************************************/
#define RB_SUCCESS 1
#define RB_NO_MEMORY 2
#define RB_INVALID_PARAM 3
#define RB_INVALID_HANDLE 4
#define RB_TIMEOUT 5
#define POINTER_T unsigned int
int rb_set_nonblocking();
int rb_create(int size, int max_event_size, int *ring_buffer_handle);
int rb_delete(int ring_buffer_handle);
int rb_get_wp(int handle, void **p, int millisec);
int rb_increment_wp(int handle, int size);
int rb_get_rp(int handle, void **p, int millisec);
int rb_increment_rp(int handle, int size);
int rb_get_buffer_level(int handle, int * n_bytes);
+176
View File
@@ -0,0 +1,176 @@
/*
Name: read_binary.C
Created by: Stefan Ritt <stefan.ritt@psi.ch>
Date: July 30th, 2014
Purpose: Example program under ROOT to read a binary data file written
by the DRSOsc program. Decode time and voltages from waveforms
and display them as a graph. Put values into a ROOT Tree for
further analysis.
To run it, do:
- Crate a file test.dat via the "Save" button in DRSOsc
- start ROOT
root [0] .L read_binary.C+
root [1] decode("test.dat");
*/
#include <string.h>
#include <stdio.h>
#include "TFile.h"
#include "TTree.h"
#include "TString.h"
#include "TGraph.h"
#include "TCanvas.h"
#include "Getline.h"
typedef struct {
char time_header[4];
char bn[2];
unsigned short board_serial_number;
} THEADER;
typedef struct {
char event_header[4];
unsigned int event_serial_number;
unsigned short year;
unsigned short month;
unsigned short day;
unsigned short hour;
unsigned short minute;
unsigned short second;
unsigned short millisecond;
unsigned short reserved1;
char bs[2];
unsigned short board_serial_number;
char tc[2];
unsigned short trigger_cell;
} EHEADER;
/*-----------------------------------------------------------------------------*/
void decode(char *filename) {
THEADER th;
EHEADER eh;
char hdr[4];
unsigned short voltage[1024];
double waveform[4][1024], time[4][1024];
float bin_width[4][1024];
char rootfile[256];
int i, j, ch, n, chn_index;
double t1, t2, dt;
// open the binary waveform file
FILE *f = fopen(Form("%s", filename), "r");
if (f == NULL) {
printf("Cannot find file \'%s\'\n", filename);
return;
}
//open the root file
strcpy(rootfile, filename);
if (strchr(rootfile, '.'))
*strchr(rootfile, '.') = 0;
strcat(rootfile, ".root");
TFile *outfile = new TFile(rootfile, "RECREATE");
// define the rec tree
TTree *rec = new TTree("rec","rec");
rec->Branch("t1", time[0] ,"t1[1024]/D");
rec->Branch("t2", time[1] ,"t2[1024]/D");
rec->Branch("t3", time[2] ,"t3[1024]/D");
rec->Branch("t4", time[3] ,"t4[1024]/D");
rec->Branch("w1", waveform[0] ,"w1[1024]/D");
rec->Branch("w2", waveform[1] ,"w2[1024]/D");
rec->Branch("w3", waveform[2] ,"w3[1024]/D");
rec->Branch("w4", waveform[3] ,"w4[1024]/D");
// create canvas
TCanvas *c1 = new TCanvas();
// create graph
TGraph *g = new TGraph(1024, (double *)time[0], (double *)waveform[0]);
// read time header
fread(&th, sizeof(th), 1, f);
printf("Found data for board #%d\n", th.board_serial_number);
// read time bin widths
memset(bin_width, sizeof(bin_width), 0);
for (ch=0 ; ch<5 ; ch++) {
fread(hdr, sizeof(hdr), 1, f);
if (hdr[0] != 'C') {
// event header found
fseek(f, -4, SEEK_CUR);
break;
}
i = hdr[3] - '0' - 1;
printf("Found timing calibration for channel #%d\n", i+1);
fread(&bin_width[i][0], sizeof(float), 1024, f);
}
// loop over all events in data file
for (n=0 ; n<5 ; n++) {
// read event header
i = fread(&eh, sizeof(eh), 1, f);
if (i < 1)
break;
printf("Found event #%d\n", eh.event_serial_number);
// reach channel data
for (ch=0 ; ch<5 ; ch++) {
i = fread(hdr, sizeof(hdr), 1, f);
if (i < 1)
break;
if (hdr[0] != 'C') {
// event header found
fseek(f, -4, SEEK_CUR);
break;
}
chn_index = hdr[3] - '0' - 1;
fread(voltage, sizeof(short), 1024, f);
for (i=0 ; i<1024 ; i++) {
// convert data to volts
waveform[chn_index][i] = (voltage[i] / 65536. - 0.5);
// calculate time for this cell
for (j=0,time[chn_index][i]=0 ; j<i ; j++)
time[chn_index][i] += bin_width[chn_index][(j+eh.trigger_cell) % 1024];
}
}
// align cell #0 of all channels
t1 = time[0][(1024-eh.trigger_cell) % 1024];
for (ch=1 ; ch<4 ; ch++) {
t2 = time[ch][(1024-eh.trigger_cell) % 1024];
dt = t1 - t2;
for (i=0 ; i<1024 ; i++)
time[ch][i] += dt;
}
// fill root tree
rec->Fill();
// fill graph
for (i=0 ; i<1024 ; i++)
g->SetPoint(i, time[0][i], waveform[0][i]);
// draw graph and wait for user click
g->Draw("ACP");
c1->Update();
gPad->WaitPrimitive();
}
// print number of events
printf("%d events processed, \"%s\" written.\n", n, rootfile);
// save and close root file
rec->Write();
outfile->Close();
}
+250
View File
@@ -0,0 +1,250 @@
/*
Name: read_binary.cpp
Created by: Stefan Ritt <stefan.ritt@psi.ch>
Date: July 30th, 2014
Purpose: Example file to read binary data saved by DRSOsc.
Compile and run it with:
gcc -o read_binary read_binary.cpp
./read_binary <filename>
This program assumes that a pulse from a signal generator is split
and fed into channels #1 and #2. It then calculates the time difference
between these two pulses to show the performance of the DRS board
for time measurements.
$Id: read_binary.cpp 22321 2016-08-25 12:26:12Z ritt $
*/
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
typedef struct {
char tag[3];
char version;
} FHEADER;
typedef struct {
char time_header[4];
} THEADER;
typedef struct {
char bn[2];
unsigned short board_serial_number;
} BHEADER;
typedef struct {
char event_header[4];
unsigned int event_serial_number;
unsigned short year;
unsigned short month;
unsigned short day;
unsigned short hour;
unsigned short minute;
unsigned short second;
unsigned short millisecond;
unsigned short range;
} EHEADER;
typedef struct {
char tc[2];
unsigned short trigger_cell;
} TCHEADER;
typedef struct {
char c[1];
char cn[3];
} CHEADER;
/*-----------------------------------------------------------------------------*/
int main(int argc, const char * argv[])
{
FHEADER fh;
THEADER th;
BHEADER bh;
EHEADER eh;
TCHEADER tch;
CHEADER ch;
unsigned int scaler;
unsigned short voltage[1024];
double waveform[16][4][1024], time[16][4][1024];
float bin_width[16][4][1024];
int i, j, b, chn, n, chn_index, n_boards;
double t1, t2, dt;
char filename[256];
int ndt;
double threshold, sumdt, sumdt2;
if (argc > 1)
strcpy(filename, argv[1]);
else {
printf("Usage: read_binary <filename>\n");
return 0;
}
// open the binary waveform file
FILE *f = fopen(filename, "rb");
if (f == NULL) {
printf("Cannot find file \'%s\'\n", filename);
return 0;
}
// read file header
fread(&fh, sizeof(fh), 1, f);
if (fh.tag[0] != 'D' || fh.tag[1] != 'R' || fh.tag[2] != 'S') {
printf("Found invalid file header in file \'%s\', aborting.\n", filename);
return 0;
}
if (fh.version != '2') {
printf("Found invalid file version \'%c\' in file \'%s\', should be \'2\', aborting.\n", fh.version, filename);
return 0;
}
// read time header
fread(&th, sizeof(th), 1, f);
if (memcmp(th.time_header, "TIME", 4) != 0) {
printf("Invalid time header in file \'%s\', aborting.\n", filename);
return 0;
}
for (b = 0 ; ; b++) {
// read board header
fread(&bh, sizeof(bh), 1, f);
if (memcmp(bh.bn, "B#", 2) != 0) {
// probably event header found
fseek(f, -4, SEEK_CUR);
break;
}
printf("Found data for board #%d\n", bh.board_serial_number);
// read time bin widths
memset(bin_width[b], sizeof(bin_width[0]), 0);
for (chn=0 ; chn<5 ; chn++) {
fread(&ch, sizeof(ch), 1, f);
if (ch.c[0] != 'C') {
// event header found
fseek(f, -4, SEEK_CUR);
break;
}
i = ch.cn[2] - '0' - 1;
printf("Found timing calibration for channel #%d\n", i+1);
fread(&bin_width[b][i][0], sizeof(float), 1024, f);
// fix for 2048 bin mode: double channel
if (bin_width[b][i][1023] > 10 || bin_width[b][i][1023] < 0.01) {
for (j=0 ; j<512 ; j++)
bin_width[b][i][j+512] = bin_width[b][i][j];
}
}
}
n_boards = b;
// initialize statistics
ndt = 0;
sumdt = sumdt2 = 0;
// loop over all events in the data file
for (n=0 ; ; n++) {
// read event header
i = (int)fread(&eh, sizeof(eh), 1, f);
if (i < 1)
break;
printf("Found event #%d %d %d\n", eh.event_serial_number, eh.second, eh.millisecond);
// loop over all boards in data file
for (b=0 ; b<n_boards ; b++) {
// read board header
fread(&bh, sizeof(bh), 1, f);
if (memcmp(bh.bn, "B#", 2) != 0) {
printf("Invalid board header in file \'%s\', aborting.\n", filename);
return 0;
}
// read trigger cell
fread(&tch, sizeof(tch), 1, f);
if (memcmp(tch.tc, "T#", 2) != 0) {
printf("Invalid trigger cell header in file \'%s\', aborting.\n", filename);
return 0;
}
if (n_boards > 1)
printf("Found data for board #%d\n", bh.board_serial_number);
// reach channel data
for (chn=0 ; chn<4 ; chn++) {
// read channel header
fread(&ch, sizeof(ch), 1, f);
if (ch.c[0] != 'C') {
// event header found
fseek(f, -4, SEEK_CUR);
break;
}
chn_index = ch.cn[2] - '0' - 1;
fread(&scaler, sizeof(int), 1, f);
fread(voltage, sizeof(short), 1024, f);
for (i=0 ; i<1024 ; i++) {
// convert data to volts
waveform[b][chn_index][i] = (voltage[i] / 65536. + eh.range/1000.0 - 0.5);
// calculate time for this cell
for (j=0,time[b][chn_index][i]=0 ; j<i ; j++)
time[b][chn_index][i] += bin_width[b][chn_index][(j+tch.trigger_cell) % 1024];
}
}
// align cell #0 of all channels
t1 = time[b][0][(1024-tch.trigger_cell) % 1024];
for (chn=1 ; chn<4 ; chn++) {
t2 = time[b][chn][(1024-tch.trigger_cell) % 1024];
dt = t1 - t2;
for (i=0 ; i<1024 ; i++)
time[b][chn][i] += dt;
}
t1 = t2 = 0;
threshold = 0.3;
// find peak in channel 1 above threshold
for (i=0 ; i<1022 ; i++)
if (waveform[b][0][i] < threshold && waveform[b][0][i+1] >= threshold) {
t1 = (threshold-waveform[b][0][i])/(waveform[b][0][i+1]-waveform[b][0][i])*(time[b][0][i+1]-time[b][0][i])+time[b][0][i];
break;
}
// find peak in channel 2 above threshold
for (i=0 ; i<1022 ; i++)
if (waveform[b][1][i] < threshold && waveform[b][1][i+1] >= threshold) {
t2 = (threshold-waveform[b][1][i])/(waveform[b][1][i+1]-waveform[b][1][i])*(time[b][1][i+1]-time[b][1][i])+time[b][1][i];
break;
}
// calculate distance of peaks with statistics
if (t1 > 0 && t2 > 0) {
ndt++;
dt = t2 - t1;
sumdt += dt;
sumdt2 += dt*dt;
}
}
}
// print statistics
printf("dT = %1.3lfns +- %1.1lfps\n", sumdt/ndt, 1000*sqrt(1.0/(ndt-1)*(sumdt2-1.0/ndt*sumdt*sumdt)));
return 1;
}
@@ -0,0 +1,230 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
D52687A518C8A3A500D244A2 /* read_binary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D52687A418C8A3A500D244A2 /* read_binary.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
D526879618C8A2A800D244A2 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
D526879818C8A2A800D244A2 /* read_binary */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = read_binary; sourceTree = BUILT_PRODUCTS_DIR; };
D52687A418C8A3A500D244A2 /* read_binary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = read_binary.cpp; path = /drs4eb/software/drsosc/read_binary.cpp; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D526879518C8A2A800D244A2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
D526878F18C8A2A800D244A2 = {
isa = PBXGroup;
children = (
D526879A18C8A2A800D244A2 /* read_binary */,
D526879918C8A2A800D244A2 /* Products */,
);
sourceTree = "<group>";
};
D526879918C8A2A800D244A2 /* Products */ = {
isa = PBXGroup;
children = (
D526879818C8A2A800D244A2 /* read_binary */,
);
name = Products;
sourceTree = "<group>";
};
D526879A18C8A2A800D244A2 /* read_binary */ = {
isa = PBXGroup;
children = (
D52687A418C8A3A500D244A2 /* read_binary.cpp */,
);
path = read_binary;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D526879718C8A2A800D244A2 /* read_binary */ = {
isa = PBXNativeTarget;
buildConfigurationList = D52687A118C8A2A800D244A2 /* Build configuration list for PBXNativeTarget "read_binary" */;
buildPhases = (
D526879418C8A2A800D244A2 /* Sources */,
D526879518C8A2A800D244A2 /* Frameworks */,
D526879618C8A2A800D244A2 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = read_binary;
productName = read_binary;
productReference = D526879818C8A2A800D244A2 /* read_binary */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D526879018C8A2A800D244A2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = "Stefan Ritt";
};
buildConfigurationList = D526879318C8A2A800D244A2 /* Build configuration list for PBXProject "read_binary" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = D526878F18C8A2A800D244A2;
productRefGroup = D526879918C8A2A800D244A2 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D526879718C8A2A800D244A2 /* read_binary */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
D526879418C8A2A800D244A2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D52687A518C8A3A500D244A2 /* read_binary.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
D526879F18C8A2A800D244A2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
D52687A018C8A2A800D244A2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
SDKROOT = macosx;
};
name = Release;
};
D52687A218C8A2A800D244A2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
D52687A318C8A2A800D244A2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D526879318C8A2A800D244A2 /* Build configuration list for PBXProject "read_binary" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D526879F18C8A2A800D244A2 /* Debug */,
D52687A018C8A2A800D244A2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D52687A118C8A2A800D244A2 /* Build configuration list for PBXNativeTarget "read_binary" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D52687A218C8A2A800D244A2 /* Debug */,
D52687A318C8A2A800D244A2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D526879018C8A2A800D244A2 /* Project object */;
}
+35
View File
@@ -0,0 +1,35 @@
/* XPM */
static const char *right_xpm[]={
"20 28 4 1",
". c None",
"b c #808080",
"a c #c0c0c0",
"# c #ffffff",
"....................",
"...###..............",
"...#aa#.............",
"...#aaa#............",
"...#aaaa#...........",
"...#aaaaa#..........",
"...#aaaaaa#.........",
"...#aaaaaaa#........",
"...#aaaaaaaa#.......",
"...#aaaaaaaaa#......",
"...#aaaaaaaaaa#.....",
"...#aaaaaaaaaaa#....",
"...#aaaaaaaaaaaa#...",
"...#aaaaaaaaaaaaa#..",
"...#aaaaaaaaaaaaab..",
"...#aaaaaaaaaaaabb..",
"...#aaaaaaaaaaabb...",
"...#aaaaaaaaaabb....",
"...#aaaaaaaaabb.....",
"...#aaaaaaaabb......",
"...#aaaaaaabb.......",
"...#aaaaaabb........",
"...#aaaaabb.........",
"...#aaaabb..........",
"...#aaabb...........",
"...#aabb............",
"....abb.............",
"...................."};
+5
View File
@@ -0,0 +1,5 @@
{
TTree *t = new TTree("t", "t");
t->ReadFile("du_u.txt", "E:Ch:Cell:U:dU");
t->Draw("U:dU");
}
+27
View File
@@ -0,0 +1,27 @@
/* XPM */
static const char *up_xpm[]={
"28 20 4 1",
". c None",
"b c #808080",
"a c #c0c0c0",
"# c #ffffff",
"............................",
"............................",
"............##..............",
"...........##aa.............",
"..........##aaaa............",
".........##aaaaaa...........",
"........##aaaaaaaa..........",
".......##aaaaaaaaaa.........",
"......##aaaaaaaaaaaa........",
".....##aaaaaaaaaaaaaa.......",
"....##aaaaaaaaaaaaaaaa......",
"...##aaaaaaaaaaaaaaaaaa.....",
"..##aaaaaaaaaaaaaaaaaaaa....",
".##aaaaaaaaaaaaaaaaaaaaaa...",
".#aaaaaaaaaaaaaaaaaaaaaaaa..",
".#aaaaaaaaaaaaaaaaaaaaaaaab.",
".#bbbbbbbbbbbbbbbbbbbbbbbbb.",
"..bbbbbbbbbbbbbbbbbbbbbbbbb.",
"............................",
"............................"};
+950
View File
@@ -0,0 +1,950 @@
/********************************************************************
DRS.h, S.Ritt, M. Schneebeli - PSI
$Id: DRS.h 21309 2014-04-11 14:51:29Z ritt $
********************************************************************/
#ifndef DRS_H
#define DRS_H
#include <stdio.h>
#include <string.h>
#include "averager.h"
#ifdef HAVE_LIBUSB
# ifndef HAVE_USB
# define HAVE_USB
# endif
#endif
#ifdef HAVE_USB
# include <musbstd.h>
#endif // HAVE_USB
#ifdef HAVE_VME
# include <mvmestd.h>
#endif // HAVE_VME
/* disable "deprecated" warning */
#ifdef _MSC_VER
#pragma warning(disable: 4996)
#endif
#ifndef NULL
#define NULL 0
#endif
int drs_kbhit();
unsigned int millitime();
/* transport mode */
#define TR_VME 1
#define TR_USB 2
#define TR_USB2 3
/* address types */
#ifndef T_CTRL
#define T_CTRL 1
#define T_STATUS 2
#define T_RAM 3
#define T_FIFO 4
#endif
/*---- Register addresses ------------------------------------------*/
#define REG_CTRL 0x00000 /* 32 bit control reg */
#define REG_DAC_OFS 0x00004
#define REG_DAC0 0x00004
#define REG_DAC1 0x00006
#define REG_DAC2 0x00008
#define REG_DAC3 0x0000A
#define REG_DAC4 0x0000C
#define REG_DAC5 0x0000E
#define REG_DAC6 0x00010
#define REG_DAC7 0x00012
#define REG_CHANNEL_CONFIG 0x00014 // low byte
#define REG_CONFIG 0x00014 // high byte
#define REG_CHANNEL_MODE 0x00016
#define REG_ADCCLK_PHASE 0x00016
#define REG_FREQ_SET_HI 0x00018 // DRS2
#define REG_FREQ_SET_LO 0x0001A // DRS2
#define REG_TRG_DELAY 0x00018 // DRS4
#define REG_FREQ_SET 0x0001A // DRS4
#define REG_TRIG_DELAY 0x0001C
#define REG_LMK_MSB 0x0001C // DRS4 Mezz
#define REG_CALIB_TIMING 0x0001E // DRS2
#define REG_EEPROM_PAGE_EVAL 0x0001E // DRS4 Eval
#define REG_EEPROM_PAGE_MEZZ 0x0001A // DRS4 Mezz
#define REG_TRG_CONFIG 0x0001C // DRS4 Eval4
#define REG_LMK_LSB 0x0001E // DRS4 Mezz
#define REG_WARMUP 0x00020 // DRS4 Mezz
#define REG_COOLDOWN 0x00022 // DRS4 Mezz
#define REG_READ_POINTER 0x00026 // DRS4 Mezz
#define REG_MAGIC 0x00000
#define REG_BOARD_TYPE 0x00002
#define REG_STATUS 0x00004
#define REG_RDAC_OFS 0x0000E
#define REG_RDAC0 0x00008
#define REG_STOP_CELL0 0x00008
#define REG_RDAC1 0x0000A
#define REG_STOP_CELL1 0x0000A
#define REG_RDAC2 0x0000C
#define REG_STOP_CELL2 0x0000C
#define REG_RDAC3 0x0000E
#define REG_STOP_CELL3 0x0000E
#define REG_RDAC4 0x00000
#define REG_RDAC5 0x00002
#define REG_STOP_WSR0 0x00010
#define REG_STOP_WSR1 0x00011
#define REG_STOP_WSR2 0x00012
#define REG_STOP_WSR3 0x00013
#define REG_RDAC6 0x00014
#define REG_RDAC7 0x00016
#define REG_EVENTS_IN_FIFO 0x00018
#define REG_EVENT_COUNT 0x0001A
#define REG_FREQ1 0x0001C
#define REG_FREQ2 0x0001E
#define REG_WRITE_POINTER 0x0001E
#define REG_TEMPERATURE 0x00020
#define REG_TRIGGER_BUS 0x00022
#define REG_SERIAL_BOARD 0x00024
#define REG_VERSION_FW 0x00026
#define REG_SCALER0 0x00028
#define REG_SCALER1 0x0002C
#define REG_SCALER2 0x00030
#define REG_SCALER3 0x00034
#define REG_SCALER4 0x00038
#define REG_SCALER5 0x0003C
/*---- Control register bit definitions ----------------------------*/
#define BIT_START_TRIG (1<<0) // write a "1" to start domino wave
#define BIT_REINIT_TRIG (1<<1) // write a "1" to stop & reset DRS
#define BIT_SOFT_TRIG (1<<2) // write a "1" to stop and read data to RAM
#define BIT_EEPROM_WRITE_TRIG (1<<3) // write a "1" to write into serial EEPROM
#define BIT_EEPROM_READ_TRIG (1<<4) // write a "1" to read from serial EEPROM
#define BIT_MULTI_BUFFER (1<<16) // Use multi buffering when "1"
#define BIT_DMODE (1<<17) // (*DRS2*) 0: single shot, 1: circular
#define BIT_ADC_ACTIVE (1<<17) // (*DRS4*) 0: stop ADC when running, 1: ADC always clocked
#define BIT_LED (1<<18) // 1=on, 0=blink during readout
#define BIT_TCAL_EN (1<<19) // switch on (1) / off (0) for 33 MHz calib signal
#define BIT_TCAL_SOURCE (1<<20)
#define BIT_REFCLK_SOURCE (1<<20)
#define BIT_FREQ_AUTO_ADJ (1<<21) // DRS2/3
#define BIT_TRANSP_MODE (1<<21) // DRS4
#define BIT_ENABLE_TRIGGER1 (1<<22) // External LEMO/FP/TRBUS trigger
#define BIT_LONG_START_PULSE (1<<23) // (*DRS2*) 0:short start pulse (>0.8GHz), 1:long start pulse (<0.8GHz)
#define BIT_READOUT_MODE (1<<23) // (*DRS3*,*DRS4*) 0:start from first bin, 1:start from domino stop
#define BIT_DELAYED_START (1<<24) // DRS2: start domino wave 400ns after soft trigger, used for waveform
// generator startup
#define BIT_NEG_TRIGGER (1<<24) // DRS4: use high-to-low trigger if set
#define BIT_ACAL_EN (1<<25) // connect DRS to inputs (0) or to DAC6 (1)
#define BIT_TRIGGER_DELAYED (1<<26) // select delayed trigger from trigger bus
#define BIT_ADCCLK_INVERT (1<<26) // invert ADC clock
#define BIT_REFCLK_EXT (1<<26) // use external MMCX CLKIN refclk
#define BIT_DACTIVE (1<<27) // keep domino wave running during readout
#define BIT_STANDBY_MODE (1<<28) // put chip in standby mode
#define BIT_TR_SOURCE1 (1<<29) // trigger source selection bits
#define BIT_DECIMATION (1<<29) // drop all odd samples (DRS4 mezz.)
#define BIT_TR_SOURCE2 (1<<30) // trigger source selection bits
#define BIT_ENABLE_TRIGGER2 (1<<31) // analog threshold (internal) trigger
/* DRS4 configuration register bit definitions */
#define BIT_CONFIG_DMODE (1<<8) // 0: single shot, 1: circular
#define BIT_CONFIG_PLLEN (1<<9) // write a "1" to enable the internal PLL
#define BIT_CONFIG_WSRLOOP (1<<10) // write a "1" to connect WSROUT to WSRIN internally
/*---- Status register bit definitions -----------------------------*/
#define BIT_RUNNING (1<<0) // one if domino wave running or readout in progress
#define BIT_NEW_FREQ1 (1<<1) // one if new frequency measurement available
#define BIT_NEW_FREQ2 (1<<2)
#define BIT_PLL_LOCKED0 (1<<1) // 1 if PLL has locked (DRS4 evaluation board only)
#define BIT_PLL_LOCKED1 (1<<2) // 1 if PLL DRS4 B has locked (DRS4 mezzanine board only)
#define BIT_PLL_LOCKED2 (1<<3) // 1 if PLL DRS4 C has locked (DRS4 mezzanine board only)
#define BIT_PLL_LOCKED3 (1<<4) // 1 if PLL DRS4 D has locked (DRS4 mezzanine board only)
#define BIT_SERIAL_BUSY (1<<5) // 1 if EEPROM operation in progress
#define BIT_LMK_LOCKED (1<<6) // 1 if PLL of LMK chip has locked (DRS4 mezzanine board only)
#define BIT_2048_MODE (1<<7) // 1 if 2048-bin mode has been soldered
enum DRSBoardConstants {
kNumberOfChannelsMax = 10,
kNumberOfCalibChannelsV3 = 10,
kNumberOfCalibChannelsV4 = 8,
kNumberOfBins = 1024,
kNumberOfChipsMax = 4,
kFrequencyCacheSize = 10,
kBSplineOrder = 4,
kPreCaliculatedBSplines = 1000,
kPreCaliculatedBSplineGroups = 5,
kNumberOfADCBins = 4096,
kBSplineXMinOffset = 20,
kMaxNumberOfClockCycles = 100,
};
enum DRSErrorCodes {
kSuccess = 0,
kInvalidTriggerSignal = -1,
kWrongChannelOrChip = -2,
kInvalidTransport = -3,
kZeroSuppression = -4,
kWaveNotAvailable = -5
};
/*---- callback class ----*/
class DRSCallback
{
public:
virtual void Progress(int value) = 0;
virtual ~DRSCallback() {};
};
/*------------------------*/
class DRSBoard;
class ResponseCalibration {
protected:
class CalibrationData {
public:
class CalibrationDataChannel {
public:
unsigned char fLimitGroup[kNumberOfBins]; //!
float fMin[kNumberOfBins]; //!
float fRange[kNumberOfBins]; //!
short fOffset[kNumberOfBins]; //!
short fGain[kNumberOfBins]; //!
unsigned short fOffsetADC[kNumberOfBins]; //!
short *fData[kNumberOfBins]; //!
unsigned char *fLookUp[kNumberOfBins]; //!
unsigned short fLookUpOffset[kNumberOfBins]; //!
unsigned char fNumberOfLookUpPoints[kNumberOfBins]; //!
float *fTempData; //!
private:
CalibrationDataChannel(const CalibrationDataChannel &c); // not implemented
CalibrationDataChannel &operator=(const CalibrationDataChannel &rhs); // not implemented
public:
CalibrationDataChannel(int numberOfGridPoints)
:fTempData(new float[numberOfGridPoints]) {
int i;
for (i = 0; i < kNumberOfBins; i++) {
fData[i] = new short[numberOfGridPoints];
}
memset(fLimitGroup, 0, sizeof(fLimitGroup));
memset(fMin, 0, sizeof(fMin));
memset(fRange, 0, sizeof(fRange));
memset(fOffset, 0, sizeof(fOffset));
memset(fGain, 0, sizeof(fGain));
memset(fOffsetADC, 0, sizeof(fOffsetADC));
memset(fLookUp, 0, sizeof(fLookUp));
memset(fLookUpOffset, 0, sizeof(fLookUpOffset));
memset(fNumberOfLookUpPoints, 0, sizeof(fNumberOfLookUpPoints));
}
~CalibrationDataChannel() {
int i;
delete fTempData;
for (i = 0; i < kNumberOfBins; i++) {
delete fData[i];
delete fLookUp[i];
}
}
};
bool fRead; //!
CalibrationDataChannel *fChannel[10]; //!
unsigned char fNumberOfGridPoints; //!
int fHasOffsetCalibration; //!
float fStartTemperature; //!
float fEndTemperature; //!
int *fBSplineOffsetLookUp[kNumberOfADCBins]; //!
float **fBSplineLookUp[kNumberOfADCBins]; //!
float fMin; //!
float fMax; //!
unsigned char fNumberOfLimitGroups; //!
static float fIntRevers[2 * kBSplineOrder - 2];
private:
CalibrationData(const CalibrationData &c); // not implemented
CalibrationData &operator=(const CalibrationData &rhs); // not implemented
public:
CalibrationData(int numberOfGridPoints);
~CalibrationData();
static int CalculateBSpline(int nGrid, float value, float *bsplines);
void PreCalculateBSpline();
void DeletePreCalculatedBSpline();
};
// General Fields
DRSBoard *fBoard;
double fPrecision;
// Fields for creating the Calibration
bool fInitialized;
bool fRecorded;
bool fFitted;
bool fOffset;
bool fCalibrationValid[2];
int fNumberOfPointsLowVolt;
int fNumberOfPoints;
int fNumberOfMode2Bins;
int fNumberOfSamples;
int fNumberOfGridPoints;
int fNumberOfXConstPoints;
int fNumberOfXConstGridPoints;
double fTriggerFrequency;
int fShowStatistics;
FILE *fCalibFile;
int fCurrentLowVoltPoint;
int fCurrentPoint;
int fCurrentSample;
int fCurrentFitChannel;
int fCurrentFitBin;
float *fResponseX[10][kNumberOfBins];
float *fResponseY;
unsigned short **fWaveFormMode3[10];
unsigned short **fWaveFormMode2[10];
short **fWaveFormOffset[10];
unsigned short **fWaveFormOffsetADC[10];
unsigned short *fSamples;
int *fSampleUsed;
float *fPntX[2];
float *fPntY[2];
float *fUValues[2];
float *fRes[kNumberOfBins];
float *fResX[kNumberOfBins];
double *fXXFit;
double *fYYFit;
double *fWWFit;
double *fYYFitRes;
double *fYYSave;
double *fXXSave;
double fGainMin;
double fGainMax;
float **fStatisticsApprox;
float **fStatisticsApproxExt;
// Fields for applying the Calibration
CalibrationData *fCalibrationData[kNumberOfChipsMax];
private:
ResponseCalibration(const ResponseCalibration &c); // not implemented
ResponseCalibration &operator=(const ResponseCalibration &rhs); // not implemented
public:
ResponseCalibration(DRSBoard* board);
~ResponseCalibration();
void SetCalibrationParameters(int numberOfPointsLowVolt, int numberOfPoints, int numberOfMode2Bins,
int numberOfSamples, int numberOfGridPoints, int numberOfXConstPoints,
int numberOfXConstGridPoints, double triggerFrequency, int showStatistics = 0);
void ResetCalibration();
bool RecordCalibrationPoints(int chipNumber);
bool RecordCalibrationPointsV3(int chipNumber);
bool RecordCalibrationPointsV4(int chipNumber);
bool FitCalibrationPoints(int chipNumber);
bool FitCalibrationPointsV3(int chipNumber);
bool FitCalibrationPointsV4(int chipNumber);
bool OffsetCalibration(int chipNumber);
bool OffsetCalibrationV3(int chipNumber);
bool OffsetCalibrationV4(int chipNumber);
double GetTemperature(unsigned int chipIndex);
bool WriteCalibration(unsigned int chipIndex);
bool WriteCalibrationV3(unsigned int chipIndex);
bool WriteCalibrationV4(unsigned int chipIndex);
bool ReadCalibration(unsigned int chipIndex);
bool ReadCalibrationV3(unsigned int chipIndex);
bool ReadCalibrationV4(unsigned int chipIndex);
bool Calibrate(unsigned int chipIndex, unsigned int channel, unsigned short *adcWaveform, short *uWaveform,
int triggerCell, float threshold, bool offsetCalib);
bool SubtractADCOffset(unsigned int chipIndex, unsigned int channel, unsigned short *adcWaveform,
unsigned short *adcCalibratedWaveform, unsigned short newBaseLevel);
bool IsRead(int chipIndex) const { return fCalibrationValid[chipIndex]; }
double GetPrecision() const { return fPrecision; };
double GetOffsetAt(int chip,int chn,int bin) const { return fCalibrationData[chip]->fChannel[chn]->fOffset[bin]; };
double GetGainAt(int chip,int chn,int bin) const { return fCalibrationData[chip]->fChannel[chn]->fGain[bin]; };
double GetMeasPointXAt(int ip) const { return fXXSave[ip]; };
double GetMeasPointYAt(int ip) const { return fYYSave[ip]; };
protected:
void InitFields(int numberOfPointsLowVolt, int numberOfPoints, int numberOfMode2Bins, int numberOfSamples,
int numberOfGridPoints, int numberOfXConstPoints, int numberOfXConstGridPoints,
double triggerFrequency, int showStatistics);
void DeleteFields();
void CalibrationTrigger(int mode, double voltage);
void CalibrationStart(double voltage);
static float GetValue(float *coefficients, float u, int n);
static int Approx(float *p, float *uu, int np, int nu, float *coef);
static void LeastSquaresAccumulation(float **matrix, int nb, int *ip, int *ir, int mt, int jt);
static int LeastSquaresSolving(float **matrix, int nb, int ip, int ir, float *x, int n);
static void Housholder(int lpivot, int l1, int m, float **u, int iU1, int iU2, float *up, float **c, int iC1,
int iC2, int ice, int ncv);
static int MakeDir(const char *path);
static void Average(int method,float *samples,int numberOfSamples,float &mean,float &error,float sigmaBoundary);
};
class DRSBoard {
protected:
class TimeData {
public:
class FrequencyData {
public:
int fFrequency;
double fBin[kNumberOfBins];
};
enum {
kMaxNumberOfFrequencies = 4000
};
int fChip;
int fNumberOfFrequencies;
FrequencyData *fFrequency[kMaxNumberOfFrequencies];
private:
TimeData(const TimeData &c); // not implemented
TimeData &operator=(const TimeData &rhs); // not implemented
public:
TimeData()
:fChip(0)
,fNumberOfFrequencies(0) {
}
~TimeData() {
int i;
for (i = 0; i < fNumberOfFrequencies; i++) {
delete fFrequency[i];
}
}
};
public:
// DAC channels (CMC Version 1 : DAC_COFSA,DAC_COFSB,DAC_DRA,DAC_DSA,DAC_TLEVEL,DAC_ACALIB,DAC_DSB,DAC_DRB)
unsigned int fDAC_COFSA;
unsigned int fDAC_COFSB;
unsigned int fDAC_DRA;
unsigned int fDAC_DSA;
unsigned int fDAC_TLEVEL;
unsigned int fDAC_ACALIB;
unsigned int fDAC_DSB;
unsigned int fDAC_DRB;
// DAC channels (CMC Version 2+3 : DAC_COFS,DAC_DSA,DAC_DSB,DAC_TLEVEL,DAC_ADCOFS,DAC_CLKOFS,DAC_ACALIB)
unsigned int fDAC_COFS;
unsigned int fDAC_ADCOFS;
unsigned int fDAC_CLKOFS;
// DAC channels (CMC Version 4 : DAC_ROFS_1,DAC_DSA,DAC_DSB,DAC_ROFS_2,DAC_ADCOFS,DAC_ACALIB,DAC_INOFS,DAC_BIAS)
unsigned int fDAC_ROFS_1;
unsigned int fDAC_ROFS_2;
unsigned int fDAC_INOFS;
unsigned int fDAC_BIAS;
// DAC channels (USB EVAL1 (fBoardType 5) : DAC_ROFS_1,DAC_CMOFS,DAC_CALN,DAC_CALP,DAC_BIAS,DAC_TLEVEL,DAC_ONOFS)
// DAC channels (USB EVAL3 (fBoardType 7) : DAC_ROFS_1,DAC_CMOFS,DAC_CALN,DAC_CALP,DAC_BIAS,DAC_TLEVEL,DAC_ONOFS)
unsigned int fDAC_CMOFS;
unsigned int fDAC_CALN;
unsigned int fDAC_CALP;
unsigned int fDAC_ONOFS;
// DAC channels (DRS4 MEZZ1 (fBoardType 6) : DAC_ONOFS,DAC_CMOFSP,DAC_CALN,DAC_CALP,DAC_BIAS,DAC_CMOFSN,DAC_ROFS_1)
unsigned int fDAC_CMOFSP;
unsigned int fDAC_CMOFSN;
// DAC channels (DRS4 EVAL4 (fBoardType 8) : DAC_ONOFS,DAC_TLEVEL4,DAC_CALN,DAC_CALP,DAC_BIAS,DAC_TLEVEL1,DAC_TLEVEL2,DAC_TLEVEL3)
unsigned int fDAC_TLEVEL1;
unsigned int fDAC_TLEVEL2;
unsigned int fDAC_TLEVEL3;
unsigned int fDAC_TLEVEL4;
protected:
// Fields for DRS
int fDRSType;
int fBoardType;
int fNumberOfChips;
int fNumberOfChannels;
int fRequiredFirmwareVersion;
int fFirmwareVersion;
int fBoardSerialNumber;
int fHasMultiBuffer;
unsigned int fTransport;
unsigned int fCtrlBits;
int fNumberOfReadoutChannels;
int fReadoutChannelConfig;
int fADCClkPhase;
bool fADCClkInvert;
double fExternalClockFrequency;
#ifdef HAVE_USB
MUSB_INTERFACE *fUsbInterface;
#endif
#ifdef HAVE_VME
MVME_INTERFACE *fVmeInterface;
mvme_addr_t fBaseAddress;
#endif
int fSlotNumber;
double fNominalFrequency;
double fTrueFrequency;
double fTCALFrequency;
double fRefClock;
int fMultiBuffer;
int fDominoMode;
int fDominoActive;
int fADCActive;
int fChannelConfig;
int fChannelCascading;
int fChannelDepth;
int fWSRLoop;
int fReadoutMode;
unsigned short fReadPointer;
int fNMultiBuffer;
int fTriggerEnable1;
int fTriggerEnable2;
int fTriggerSource;
int fTriggerDelay;
double fTriggerDelayNs;
int fSyncDelay;
int fDelayedStart;
int fTranspMode;
int fDecimation;
unsigned short fStopCell[4];
unsigned char fStopWSR[4];
unsigned short fTriggerBus;
double fROFS;
double fRange;
double fCommonMode;
int fAcalMode;
int fbkAcalMode;
double fAcalVolt;
double fbkAcalVolt;
int fTcalFreq;
int fbkTcalFreq;
int fTcalLevel;
int fbkTcalLevel;
int fTcalPhase;
int fTcalSource;
int fRefclk;
unsigned char fWaveforms[kNumberOfChipsMax * kNumberOfChannelsMax * 2 * kNumberOfBins];
// Fields for Calibration
int fMaxChips;
char fCalibDirectory[1000];
// Fields for Response Calibration old method
ResponseCalibration *fResponseCalibration;
// Fields for Calibration new method
bool fVoltageCalibrationValid;
double fCellCalibratedRange;
double fCellCalibratedTemperature;
unsigned short fCellOffset[kNumberOfChipsMax * kNumberOfChannelsMax][kNumberOfBins];
unsigned short fCellOffset2[kNumberOfChipsMax * kNumberOfChannelsMax][kNumberOfBins];
double fCellGain[kNumberOfChipsMax * kNumberOfChannelsMax][kNumberOfBins];
double fTimingCalibratedFrequency;
double fCellDT[kNumberOfChipsMax][kNumberOfChannelsMax][kNumberOfBins];
// Fields for Time Calibration
TimeData **fTimeData;
int fNumberOfTimeData;
// General debugging flag
int fDebug;
// Fields for wave transfer
bool fWaveTransferred[kNumberOfChipsMax * kNumberOfChannelsMax];
// Waveform Rotation
int fTriggerStartBin; // Start Bin of the trigger
private:
DRSBoard(const DRSBoard &c); // not implemented
DRSBoard &operator=(const DRSBoard &rhs); // not implemented
public:
// Public Methods
#ifdef HAVE_USB
DRSBoard(MUSB_INTERFACE * musb_interface, int usb_slot);
#endif
#ifdef HAVE_VME
DRSBoard(MVME_INTERFACE * mvme_interface, mvme_addr_t base_address, int slot_number);
MVME_INTERFACE *GetVMEInterface() const { return fVmeInterface; };
#endif
~DRSBoard();
int SetBoardSerialNumber(unsigned short serialNumber);
int GetBoardSerialNumber() const { return fBoardSerialNumber; }
int HasMultiBuffer() const { return fHasMultiBuffer; }
int GetFirmwareVersion() const { return fFirmwareVersion; }
int GetRequiredFirmwareVersion() const { return fRequiredFirmwareVersion; }
int GetDRSType() const { return fDRSType; }
int GetBoardType() const { return fBoardType; }
int GetNumberOfChips() const { return fNumberOfChips; }
// channel : Flash ADC index
// readout channel : VME readout index
// input : Input on board
int GetNumberOfChannels() const { return fNumberOfChannels; }
int GetChannelDepth() const { return fChannelDepth; }
int GetChannelCascading() const { return fChannelCascading; }
inline int GetNumberOfReadoutChannels() const;
inline int GetWaveformBufferSize() const;
inline int GetNumberOfInputs() const;
inline int GetNumberOfCalibInputs() const;
inline int GetClockChannel() const;
inline int GetTriggerChannel() const;
inline int GetClockInput() const { return Channel2Input(GetClockChannel()); }
inline int GetTriggerInput() const { return fDRSType < 4 ? Channel2Input(GetTriggerChannel()) : -1; }
inline int Channel2Input(int channel) const;
inline int Channel2ReadoutChannel(int channel) const;
inline int Input2Channel(int input, int ind = 0) const;
inline int Input2ReadoutChannel(int input, int ind = 0) const;
inline int ReadoutChannel2Channel(int readout) const;
inline int ReadoutChannel2Input(int readout) const;
inline bool IsCalibChannel(int ch) const;
inline bool IsCalibInput(int input) const;
int GetSlotNumber() const { return fSlotNumber; }
int InitFPGA(void);
int Write(int type, unsigned int addr, void *data, int size);
int Read(int type, void *data, unsigned int addr, int size);
int GetTransport() const { return fTransport; }
void RegisterTest(void);
int RAMTest(int flag);
int ChipTest();
unsigned int GetCtrlReg(void);
unsigned short GetConfigReg(void);
unsigned int GetStatusReg(void);
void SetLED(int state);
int SetChannelConfig(int firstChannel, int lastChannel, int nConfigChannels);
void SetADCClkPhase(int phase, bool invert);
void SetWarmup(unsigned int ticks);
void SetCooldown(unsigned int ticks);
int GetReadoutChannelConfig() { return fReadoutChannelConfig; }
void SetNumberOfChannels(int nChannels);
int EnableTrigger(int flag1, int flag2);
int GetTriggerEnable(int i) { return i?fTriggerEnable2:fTriggerEnable1; }
int SetDelayedTrigger(int flag);
int SetTriggerDelayPercent(int delay);
int SetTriggerDelayNs(int delay);
int GetTriggerDelay() { return fTriggerDelay; }
double GetTriggerDelayNs() { return fTriggerDelayNs; }
int SetSyncDelay(int ticks);
int SetTriggerLevel(double value);
int SetIndividualTriggerLevel(int channel, double voltage);
int SetTriggerPolarity(bool negative);
int SetTriggerSource(int source);
int GetTriggerSource() { return fTriggerSource; }
int SetDelayedStart(int flag);
int SetTranspMode(int flag);
int SetStandbyMode(int flag);
int SetDecimation(int flag);
int GetDecimation() { return fDecimation; }
int IsBusy(void);
int IsEventAvailable(void);
int IsPLLLocked(void);
int IsLMKLocked(void);
int IsNewFreq(unsigned char chipIndex);
int SetDAC(unsigned char channel, double value);
int ReadDAC(unsigned char channel, double *value);
int GetRegulationDAC(double *value);
int StartDomino();
int StartClearCycle();
int FinishClearCycle();
int Reinit();
int Init();
void SetDebug(int debug) { fDebug = debug; }
int Debug() { return fDebug; }
int SetDominoMode(unsigned char mode);
int SetDominoActive(unsigned char mode);
int SetReadoutMode(unsigned char mode);
int SoftTrigger(void);
int ReadFrequency(unsigned char chipIndex, double *f);
int SetFrequency(double freq, bool wait);
double VoltToFreq(double volt);
double FreqToVolt(double freq);
double GetNominalFrequency() const { return fNominalFrequency; }
double GetTrueFrequency();
int RegulateFrequency(double freq);
int SetExternalClockFrequency(double frequencyMHz);
double GetExternalClockFrequency();
int SetMultiBuffer(int flag);
int IsMultiBuffer() { return fMultiBuffer; }
void ResetMultiBuffer(void);
int GetMultiBufferRP(void);
int SetMultiBufferRP(unsigned short rp);
int GetMultiBufferWP(void);
void IncrementMultiBufferRP(void);
void SetVoltageOffset(double offset1, double offset2);
int SetInputRange(double center);
double GetInputRange(void) { return fRange; }
double GetCalibratedInputRange(void) { return fCellCalibratedRange; }
double GetCalibratedTemperature(void) { return fCellCalibratedTemperature; }
double GetCalibratedFrequency(void) { return fTimingCalibratedFrequency; }
int TransferWaves(int numberOfChannels = kNumberOfChipsMax * kNumberOfChannelsMax);
int TransferWaves(unsigned char *p, int numberOfChannels = kNumberOfChipsMax * kNumberOfChannelsMax);
int TransferWaves(int firstChannel, int lastChannel);
int TransferWaves(unsigned char *p, int firstChannel, int lastChannel);
int DecodeWave(unsigned char *waveforms, unsigned int chipIndex, unsigned char channel,
unsigned short *waveform);
int DecodeWave(unsigned int chipIndex, unsigned char channel, unsigned short *waveform);
int GetWave(unsigned char *waveforms, unsigned int chipIndex, unsigned char channel, short *waveform,
bool responseCalib = false, int triggerCell = -1, int wsr = -1, bool adjustToClock = false,
float threshold = 0, bool offsetCalib = true);
int GetWave(unsigned char *waveforms, unsigned int chipIndex, unsigned char channel, float *waveform,
bool responseCalib = false, int triggerCell = -1, int wsr = -1, bool adjustToClock = false,
float threshold = 0, bool offsetCalib = true);
int GetWave(unsigned int chipIndex, unsigned char channel, short *waveform, bool responseCalib = false,
int triggerCell = -1, int wsr = -1, bool adjustToClock = false, float threshold = 0, bool offsetCalib = true);
int GetWave(unsigned int chipIndex, unsigned char channel, float *waveform, bool responseCalib,
int triggerCell = -1, int wsr = -1, bool adjustToClock = false, float threshold = 0, bool offsetCalib = true);
int GetWave(unsigned int chipIndex, unsigned char channel, float *waveform);
int GetRawWave(unsigned int chipIndex, unsigned char channel, unsigned short *waveform, bool adjustToClock = false);
int GetRawWave(unsigned char *waveforms,unsigned int chipIndex, unsigned char channel,
unsigned short *waveform, bool adjustToClock = false);
bool IsTimingCalibrationValid(void);
bool IsVoltageCalibrationValid(void) { return fVoltageCalibrationValid; }
int GetTime(unsigned int chipIndex, int channelIndex, double freq, int tc, float *time, bool tcalibrated=true, bool rotated=true);
int GetTime(unsigned int chipIndex, int channelIndex, int tc, float *time, bool tcalibrated=true, bool rotated=true);
int GetTimeCalibration(unsigned int chipIndex, int channelIndex, int mode, float *time, bool force=false);
int GetTriggerCell(unsigned int chipIndex);
int GetStopCell(unsigned int chipIndex);
unsigned char GetStopWSR(unsigned int chipIndex);
int GetTriggerCell(unsigned char *waveforms,unsigned int chipIndex);
void TestDAC(int channel);
void MeasureSpeed();
void InteractSpeed();
void MonitorFrequency();
int TestShift(int n);
int EnableAcal(int mode, double voltage);
int GetAcalMode() { return fAcalMode; }
double GetAcalVolt() { return fAcalVolt; }
int EnableTcal(int freq, int level=0, int phase=0);
int SelectClockSource(int source);
int SetRefclk(int source);
int GetRefclk() { return fRefclk; }
int GetTcalFreq() { return fTcalFreq; }
int GetTcalLevel() { return fTcalLevel; }
int GetTcalPhase() { return fTcalPhase; }
int GetTcalSource() { return fTcalSource; }
int SetCalibVoltage(double value);
int SetCalibTiming(int t1, int t2);
double GetTemperature();
int Is2048ModeCapable();
int GetTriggerBus();
unsigned int GetScaler(int channel);
int ReadEEPROM(unsigned short page, void *buffer, int size);
int WriteEEPROM(unsigned short page, void *buffer, int size);
bool HasCorrectFirmware();
int ConfigureLMK(double sampFreq, bool freqChange, int calFreq, int calPhase);
bool InitTimeCalibration(unsigned int chipIndex);
void SetCalibrationDirectory(const char *calibrationDirectoryPath);
void GetCalibrationDirectory(char *calibrationDirectoryPath);
ResponseCalibration *GetResponseCalibration() const { return fResponseCalibration; }
double GetPrecision() const { return fResponseCalibration ? fResponseCalibration->GetPrecision() : 0.1; }
int CalibrateWaveform(unsigned int chipIndex, unsigned char channel, unsigned short *adcWaveform,
short *waveform, bool responseCalib, int triggerCell, bool adjustToClock,
float threshold, bool offsetCalib);
static void LinearRegression(double *x, double *y, int n, double *a, double *b);
void ReadSingleWaveform(int nChips, int nChan,
unsigned short wfu[kNumberOfChipsMax][kNumberOfChannelsMax][kNumberOfBins], bool rotated);
int AverageWaveforms(DRSCallback *pcb, int chipIndex, int nChan, int prog1, int prog2, unsigned short *awf, int n, bool rotated);
int RobustAverageWaveforms(DRSCallback *pcb, int chipIndex, int nChan, int prog1, int prog2, unsigned short *awf, int n, bool rotated);
int CalibrateVolt(DRSCallback *pcb);
int AnalyzePeriod(Averager *ave, int iIter, int nIter, int channel, float wf[kNumberOfBins], int tCell, double cellDV[kNumberOfBins], double cellDT[kNumberOfBins]);
int AnalyzeSlope(Averager *ave, int iIter, int nIter, int channel, float wf[kNumberOfBins], int tCell, double cellDV[kNumberOfBins], double cellDT[kNumberOfBins]);
int CalibrateTiming(DRSCallback *pcb);
static void RemoveSymmetricSpikes(short **wf, int nwf,
short diffThreshold, int spikeWidth,
short maxPeakToPeak, short spikeVoltage,
int nTimeRegionThreshold);
protected:
// Protected Methods
void ConstructBoard();
void ReadSerialNumber();
void ReadCalibration(void);
TimeData *GetTimeCalibration(unsigned int chipIndex, bool reinit = false);
int GetStretchedTime(float *time, float *measurement, int numberOfMeasurements, float period);
};
int DRSBoard::GetNumberOfReadoutChannels() const
{
return (fDRSType == 4 && fReadoutChannelConfig == 4) ? 5 : fNumberOfChannels;
}
int DRSBoard::GetWaveformBufferSize() const
{
int nbin=0;
if (fDRSType < 4) {
nbin = fNumberOfChips * fNumberOfChannels * kNumberOfBins;
} else {
if (fBoardType == 6) {
if (fDecimation) {
nbin = fNumberOfChips * (4 * kNumberOfBins + kNumberOfBins / 2);
} else {
nbin = fNumberOfChips * 5 * kNumberOfBins;
}
} else if (fBoardType == 7 || fBoardType == 8 || fBoardType == 9)
nbin = fNumberOfChips * fNumberOfChannels * kNumberOfBins;
}
return nbin * static_cast<int>(sizeof(short int));
}
int DRSBoard::GetNumberOfInputs() const
{
// return number of input channels excluding clock and trigger channels.
if (fDRSType < 4) {
return fNumberOfChannels - 2;
} else {
return fNumberOfChannels / 2;
}
}
int DRSBoard::GetNumberOfCalibInputs() const
{
return (fDRSType < 4) ? 2 : 1;
}
int DRSBoard::GetClockChannel() const
{
return fDRSType < 4 ? 9 : 8;
}
int DRSBoard::GetTriggerChannel() const
{
return fDRSType < 4 ? 8 : -1;
}
int DRSBoard::Channel2Input(int channel) const
{
return (fDRSType < 4) ? channel : channel / 2;
}
int DRSBoard::Channel2ReadoutChannel(int channel) const
{
if (fDRSType < 4) {
return channel;
} else {
if (fReadoutChannelConfig == 4) {
return channel / 2;
} else {
return channel;
}
}
}
int DRSBoard::Input2Channel(int input, int ind) const
{
if (fChannelCascading == 1) {
return (fDRSType < 4) ? input : (input * 2 + ind);
} else {
if (input == 4) { // clock
return 8;
} else {
return input;
}
}
}
int DRSBoard::Input2ReadoutChannel(int input, int ind) const
{
if (fDRSType < 4) {
return input;
} else {
if (fReadoutChannelConfig == 4) {
return input;
} else {
return (input * 2 + ind);
}
}
}
int DRSBoard::ReadoutChannel2Channel(int readout) const
{
if (fDRSType < 4) {
return readout;
} else {
if (fReadoutChannelConfig == 4) {
return readout * 2;
} else {
return readout;
}
}
}
int DRSBoard::ReadoutChannel2Input(int readout) const
{
if (fDRSType < 4) {
return readout;
} else {
if (fReadoutChannelConfig == 4) {
return readout;
} else {
return readout / 2;
}
}
}
bool DRSBoard::IsCalibChannel(int ch) const
{
// return if it is clock or trigger channel
if (fDRSType < 4)
return ch == GetClockChannel() || ch == GetTriggerChannel();
else
return ch == GetClockChannel();
}
bool DRSBoard::IsCalibInput(int input) const
{
// return if it is clock or trigger channel
int ch = Input2Channel(input);
if (fDRSType < 4)
return ch == GetClockChannel() || ch == GetTriggerChannel();
else
return ch == GetClockChannel();
}
class DRS {
protected:
// constants
enum {
kMaxNumberOfBoards = 40
};
protected:
DRSBoard *fBoard[kMaxNumberOfBoards];
int fNumberOfBoards;
char fError[256];
#ifdef HAVE_VME
MVME_INTERFACE *fVmeInterface;
#endif
private:
DRS(const DRS &c); // not implemented
DRS &operator=(const DRS &rhs); // not implemented
public:
// Public Methods
DRS();
~DRS();
DRSBoard *GetBoard(int i) { return fBoard[i]; }
void SetBoard(int i, DRSBoard *b);
DRSBoard **GetBoards() { return fBoard; }
int GetNumberOfBoards() const { return fNumberOfBoards; }
bool GetError(char *str, int size);
void SortBoards();
#ifdef HAVE_VME
MVME_INTERFACE *GetVMEInterface() const { return fVmeInterface; };
#endif
};
#endif // DRS_H
+28
View File
@@ -0,0 +1,28 @@
/********************************************************************\
Name: averager.h
Created by: Stefan Ritt
Contents: Robust averager
$Id: averager.h 21220 2013-12-20 13:47:43Z ritt $
\********************************************************************/
class Averager {
int fNx, fNy, fNz, fDim;
float *fArray;
unsigned short *fN;
public:
Averager(int nx, int ny, int nz, int dim);
~Averager();
void Add(int x, int y, int z, float value);
void Reset();
double Average(int x, int y, int z);
double Median(int x, int y, int z);
double RobustAverage(double range, int x, int y, int z);
int SaveNormalizedDistribution(const char *filename, int x, float range);
};
+95
View File
@@ -0,0 +1,95 @@
/********************************************************************\
Name: musbstd.h
Created by: Konstantin Olchanski, Stefan Ritt
Contents: Midas USB access
$Id$
\********************************************************************/
#ifndef MUSBSTD_H
#define MUSBSTD_H
#if defined(HAVE_LIBUSB)
#include <usb.h>
typedef struct {
usb_dev_handle *dev;
int usb_configuration;
int usb_interface;
int usb_type;
} MUSB_INTERFACE;
#elif defined(HAVE_LIBUSB10)
#include <libusb-1.0/libusb.h>
typedef struct {
libusb_device_handle *dev;
int usb_configuration;
int usb_interface;
int usb_type;
} MUSB_INTERFACE;
#elif defined(_MSC_VER)
#include <windows.h>
typedef struct {
HANDLE rhandle;
HANDLE whandle;
int usb_type;
} MUSB_INTERFACE;
#elif defined(OS_DARWIN)
typedef struct {
void *device;
void *interface;
int usb_configuration;
int usb_interface;
int usb_type;
} MUSB_INTERFACE;
#else
#error Do not know how to access USB devices
#endif
/*---- status codes ------------------------------------------------*/
#define MUSB_SUCCESS 1
#define MUSB_NOT_FOUND 2
#define MUSB_INVALID_PARAM 3
#define MUSB_NO_MEM 4
#define MUSB_ACCESS_ERROR 5
/* make functions callable from a C++ program */
#ifdef __cplusplus
extern "C" {
#endif
/* make functions under WinNT dll exportable */
#ifndef EXPRT
#if defined(_MSC_VER) && defined(_USRDLL)
#define EXPRT __declspec(dllexport)
#else
#define EXPRT
#endif
#endif
int EXPRT musb_open(MUSB_INTERFACE **musb_interface, int vendor, int product, int instance, int configuration, int usbinterface);
int EXPRT musb_close(MUSB_INTERFACE *musb_interface);
int EXPRT musb_write(MUSB_INTERFACE *musb_interface,int endpoint,const void *buf,int count,int timeout_ms);
int EXPRT musb_read(MUSB_INTERFACE *musb_interface,int endpoint,void *buf,int count,int timeout_ms);
int EXPRT musb_reset(MUSB_INTERFACE *musb_interface);
int EXPRT musb_set_altinterface(MUSB_INTERFACE *musb_interface, int index);
int EXPRT musb_get_device(MUSB_INTERFACE *musb_interface);
#ifdef __cplusplus
}
#endif
#endif // MUSBSTD_H
+156
View File
@@ -0,0 +1,156 @@
/********************************************************************\
Name: mxml.h
Created by: Stefan Ritt
Copyright 2000 + Stefan Ritt
Contents: Header file for mxml.c
This file is part of MIDAS XML Library.
MIDAS XML Library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MIDAS XML Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MIDAS XML Library. If not, see <http://www.gnu.org/licenses/>.
\********************************************************************/
/*------------------------------------------------------------------*/
#ifndef _MXML_H_
#define _MXML_H_
#define MXML_NAME_LENGTH 64
#define ELEMENT_NODE 1
#define TEXT_NODE 2
#define PROCESSING_INSTRUCTION_NODE 3
#define COMMENT_NODE 4
#define DOCUMENT_NODE 5
#define INTERNAL_ENTITY 0
#define EXTERNAL_ENTITY 1
#define MXML_MAX_ENTITY 500
#define MXML_MAX_CONDITION 10
#ifdef _MSC_VER
#define DIR_SEPARATOR '\\'
#else
#define DIR_SEPARATOR '/'
#endif
typedef struct {
int fh;
char *buffer;
int buffer_size;
int buffer_len;
int level;
int element_is_open;
int data_was_written;
char **stack;
int translate;
} MXML_WRITER;
typedef struct mxml_struct *PMXML_NODE;
typedef struct mxml_struct {
char name[MXML_NAME_LENGTH]; // name of element <[name]>[value]</[name]>
int node_type; // type of node XXX_NODE
char *value; // value of element
int n_attributes; // list of attributes
char *attribute_name;
char **attribute_value;
int line_number_start; // first line number in XML file, starting from 1
int line_number_end; // last line number in XML file, starting from 1
PMXML_NODE parent; // pointer to parent element
int n_children; // list of children
PMXML_NODE child;
} MXML_NODE;
/*------------------------------------------------------------------*/
/* make functions callable from a C++ program */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef EXPRT
#if defined(EXPORT_DLL)
#define EXPRT __declspec(dllexport)
#else
#define EXPRT
#endif
#endif
void mxml_suppress_date(int suppress);
MXML_WRITER *mxml_open_file(const char *file_name);
MXML_WRITER *mxml_open_buffer(void);
int mxml_set_translate(MXML_WRITER *writer, int flag);
int mxml_start_element(MXML_WRITER *writer, const char *name);
int mxml_start_element_noindent(MXML_WRITER *writer, const char *name);
int mxml_end_element(MXML_WRITER *writer);
int mxml_write_comment(MXML_WRITER *writer, const char *string);
int mxml_write_element(MXML_WRITER *writer, const char *name, const char *value);
int mxml_write_attribute(MXML_WRITER *writer, const char *name, const char *value);
int mxml_write_value(MXML_WRITER *writer, const char *value);
int mxml_write_empty_line(MXML_WRITER *writer);
char *mxml_close_buffer(MXML_WRITER *writer);
int mxml_close_file(MXML_WRITER *writer);
int mxml_get_number_of_children(PMXML_NODE pnode);
PMXML_NODE mxml_get_parent(PMXML_NODE pnode);
PMXML_NODE mxml_subnode(PMXML_NODE pnode, int idx);
PMXML_NODE mxml_find_node(PMXML_NODE tree, const char *xml_path);
int mxml_find_nodes(PMXML_NODE tree, const char *xml_path, PMXML_NODE **nodelist);
char *mxml_get_name(PMXML_NODE pnode);
char *mxml_get_value(PMXML_NODE pnode);
int mxml_get_line_number_start(PMXML_NODE pnode);
int mxml_get_line_number_end(PMXML_NODE pnode);
PMXML_NODE mxml_get_node_at_line(PMXML_NODE tree, int linenumber);
char *mxml_get_attribute(PMXML_NODE pnode, const char *name);
int mxml_add_attribute(PMXML_NODE pnode, const char *attrib_name, const char *attrib_value);
PMXML_NODE mxml_add_special_node(PMXML_NODE parent, int node_type, const char *node_name, const char *value);
PMXML_NODE mxml_add_special_node_at(PMXML_NODE parent, int node_type, const char *node_name, const char *value, int idx);
PMXML_NODE mxml_add_node(PMXML_NODE parent, const char *node_name, const char *value);
PMXML_NODE mxml_add_node_at(PMXML_NODE parent, const char *node_name, const char *value, int idx);
PMXML_NODE mxml_clone_tree(PMXML_NODE tree);
int mxml_add_tree(PMXML_NODE parent, PMXML_NODE tree);
int mxml_add_tree_at(PMXML_NODE parent, PMXML_NODE tree, int idx);
int mxml_replace_node_name(PMXML_NODE pnode, const char *new_name);
int mxml_replace_node_value(PMXML_NODE pnode, const char *value);
int mxml_replace_subvalue(PMXML_NODE pnode, const char *name, const char *value);
int mxml_replace_attribute_name(PMXML_NODE pnode, const char *old_name, const char *new_name);
int mxml_replace_attribute_value(PMXML_NODE pnode, const char *attrib_name, const char *attrib_value);
int mxml_delete_node(PMXML_NODE pnode);
int mxml_delete_attribute(PMXML_NODE, const char *attrib_name);
PMXML_NODE mxml_create_root_node(void);
PMXML_NODE mxml_parse_file(const char *file_name, char *error, int error_size, int *error_line);
PMXML_NODE mxml_parse_buffer(const char *buffer, char *error, int error_size, int *error_line);
int mxml_parse_entity(char **buf, const char* file_name, char *error, int error_size, int *error_line);
int mxml_write_tree(const char *file_name, PMXML_NODE tree);
void mxml_debug_tree(PMXML_NODE tree, int level);
void mxml_free_tree(PMXML_NODE tree);
void mxml_dirname(char* path);
void mxml_basename(char *path);
#ifdef __cplusplus
}
#endif
#endif /* _MXML_H_ */
/*------------------------------------------------------------------*/
+55
View File
@@ -0,0 +1,55 @@
/********************************************************************\
Name: strlcpy.h
Created by: Stefan Ritt
Copyright 2000 + Stefan Ritt
Contents: Header file for strlcpy.c
This file is part of MIDAS XML Library.
MIDAS XML Library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MIDAS XML Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MIDAS XML Library. If not, see <http://www.gnu.org/licenses/>.
\********************************************************************/
#ifndef _STRLCPY_H_
#define _STRLCPY_H_
// some version of gcc have a built-in strlcpy
#ifdef strlcpy
#define STRLCPY_DEFINED
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef EXPRT
#if defined(EXPORT_DLL)
#define EXPRT __declspec(dllexport)
#else
#define EXPRT
#endif
#endif
#ifndef STRLCPY_DEFINED
size_t EXPRT strlcpy(char *dst, const char *src, size_t size);
size_t EXPRT strlcat(char *dst, const char *src, size_t size);
#endif
#ifdef __cplusplus
}
#endif
#endif /*_STRLCPY_H_ */
Binary file not shown.
Binary file not shown.
+145
View File
@@ -0,0 +1,145 @@
; drs4_eval5.inf
; Jan 31st, 2014 S. Ritt, PSI
;
; ===================== Strings =======================
[Strings]
; =====================================================
; ========= START USER CONFIGURABLE SECTION ===========
; =====================================================
DeviceName = "DRS4 Evaluation Board"
VendorID = "VID_04B4"
ProductID = "PID_1175"
DeviceGUID = "{9EB890AE-898F-4980-968D-C39EF0BBC3E4}"
DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}"
Date = "01/31/2014"
; =====================================================
; ========== END USER CONFIGURABLE SECTION ============
; =====================================================
ProviderName = "libusb 1.0"
WinUSB_SvcDesc = "WinUSB Driver Service"
DiskName = "libusb (WinUSB) Device Install Disk"
ClassName = "libusb (WinUSB) devices"
; ====================== Version ======================
[Version]
DriverVer = %Date%
Signature = "$Windows NT$"
Class = %ClassName%
ClassGuid = %DeviceClassGUID%
Provider = %ProviderName%
CatalogFile = libusb_device.cat
; =================== Class section ===================
; Since the device is not a standard USB device, we define a new class for it.
[ClassInstall32]
Addreg = WinUSBDeviceClassReg
[WinUSBDeviceClassReg]
HKR,,,0,%ClassName%
; -20 is for the USB icon
HKR,,Icon,,-20
; =========== Manufacturer/Models sections ============
[Manufacturer]
%ProviderName% = libusbDevice_WinUSB,NTx86,NTamd64
[libusbDevice_WinUSB.NTx86]
%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%
[libusbDevice_WinUSB.NTamd64]
%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%
; ==================== Installation ===================
; The Include and Needs directives in the USB_Install section are required for
; installing WinUSB on Windows Vista systems. Windows XP systems ignore these
; directives. These directives should not be modified.
[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT
; The Include directive in the USB_Install.Services section includes the system-
; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if
; it is not already on the target system. The AddService directive specifies
; WinUsb.sys as the devices function driver. These directives should not be
; modified.
[USB_Install.Services]
Include=winusb.inf
AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
; The WinUSB_ServiceInstall section contains the data for installing WinUsb.sys
; as a service. This section should not be modified.
[WinUSB_ServiceInstall]
DisplayName = %WinUSB_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys
; The KmdfService directive installs WinUsb.sys as a kernel-mode service. The
; referenced WinUSB_Install section specifies the KMDF library version.
; Usually, the version can be derived from the WdfCoInstallerxxyyy.dll with
; xx = major, yyy = minor
[USB_Install.Wdf]
KmdfService=WINUSB, WinUsb_Install
[WinUSB_Install]
KmdfLibraryVersion=1.9
; USB_Install.HW is the key section in the INF. It specifies the device
; interface globally unique identifier (GUID) for your device. The AddReg
; directive puts the interface GUID in a standard registry value. When
; WinUsb.sys is loaded as the devices function driver, it reads the registry
; value and uses the specified GUID to represent the device interface. You
; should replace the GUID in this example with one that you create specifically
; for your device. If the protocols for the device change, you should create a
; new device interface GUID.
[USB_Install.HW]
AddReg=Dev_AddReg
[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
; The USB_Install.CoInstallers section, including the referenced AddReg and
; CopyFiles sections, contains data and instructions to install the WinUSB and
; KMDF co installers and associate them with the device. Most USB devices can
; use these sections and directives without modification.
[USB_Install.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles
[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
[CoInstallers_CopyFiles]
WinUSBCoInstaller2.dll
WdfCoInstaller01009.dll
[DestinationDirs]
CoInstallers_CopyFiles=11
; =============== Source Media Section ================
; The x86 and x64 versions of Windows have separate co installers. This example
; stores them on the installation disk in folders that are named x86 and amd64
[SourceDisksNames]
1 = %DiskName%,,,\x86
2 = %DiskName%,,,\amd64
[SourceDisksFiles.x86]
WinUSBCoInstaller2.dll=1
WdfCoInstaller01009.dll=1
[SourceDisksFiles.amd64]
WinUSBCoInstaller2.dll=2
WdfCoInstaller01009.dll=2
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
+7734
View File
File diff suppressed because it is too large Load Diff
+214
View File
@@ -0,0 +1,214 @@
/********************************************************************\
Name: averager.cpp
Created by: Stefan Ritt
Contents: Robust averager
$Id: averager.cpp 21210 2013-12-12 11:36:59Z ritt $
\********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include "averager.h"
/*----------------------------------------------------------------*/
Averager::Averager(int nx, int ny, int nz, int dim)
{
fNx = nx;
fNy = ny;
fNz = nz;
fDim = dim;
int size = sizeof(float)*nx*ny*nz * dim;
fArray = (float *)malloc(size);
assert(fArray);
memset(fArray, 0, size);
size = sizeof(float)*nx*ny*nz;
fN = (unsigned short *)malloc(size);
assert(fN);
memset(fN, 0, size);
}
/*----------------------------------------------------------------*/
Averager::~Averager()
{
if (fN)
free(fN);
if (fArray)
free(fArray);
fN = NULL;
fArray = NULL;
}
/*----------------------------------------------------------------*/
void Averager::Add(int x, int y, int z, float value)
{
assert(x < fNx);
assert(y < fNy);
assert(z < fNz);
int nIndex = (x*fNy + y)*fNz + z;
if (fN[nIndex] == fDim - 1) // check if array full
return;
int aIndex = ((x*fNy + y)*fNz + z) * fDim + fN[nIndex];
fN[nIndex]++;
fArray[aIndex] = value;
}
/*----------------------------------------------------------------*/
void Averager::Reset()
{
int size = sizeof(float)*fNx*fNy*fNz * fDim;
memset(fArray, 0, size);
size = sizeof(float)*fNx*fNy*fNz;
memset(fN, 0, size);
}
/*----------------------------------------------------------------*/
int compar(const void *a, const void *b);
int compar(const void *a, const void *b)
{
if (*((float *)a) == *((float *)b))
return 0;
return (*((float *)a) < *((float *)b)) ? -1 : 1;
}
double Averager::Average(int x, int y, int z)
{
assert(x < fNx);
assert(y < fNy);
assert(z < fNz);
double a = 0;
int nIndex = (x*fNy + y)*fNz + z;
int aIndex = ((x*fNy + y)*fNz + z) * fDim;
for (int i=0 ; i<fN[nIndex] ; i++)
a += fArray[aIndex + i];
if (fN[nIndex] > 0)
a /= fN[nIndex];
return a;
}
/*----------------------------------------------------------------*/
double Averager::Median(int x, int y, int z)
{
assert(x < fNx);
assert(y < fNy);
assert(z < fNz);
double m = 0;
int nIndex = (x*fNy + y)*fNz + z;
int aIndex = ((x*fNy + y)*fNz + z) * fDim;
qsort(&fArray[aIndex], fN[nIndex], sizeof(float), compar);
m = fArray[aIndex + fN[nIndex]/2];
return m;
}
/*----------------------------------------------------------------*/
double Averager::RobustAverage(double range, int x, int y, int z)
{
assert(x < fNx);
assert(y < fNy);
assert(z < fNz);
double ra = 0;
int n = 0;
double m = Median(x, y, z);
int nIndex = (x*fNy + y)*fNz + z;
int aIndex = ((x*fNy + y)*fNz + z) * fDim;
for (int i=0 ; i<fN[nIndex] ; i++) {
if (fArray[aIndex + i] > m - range && fArray[aIndex + i] < m + range) {
ra += fArray[aIndex + i];
n++;
}
}
if (n > 0)
ra /= n;
//if (y == 0 && z == 7 && fN[nIndex] > 10)
// printf("%d %lf %lf %lf\n", fN[nIndex], a, m, ra);
return ra;
}
/*----------------------------------------------------------------*/
int Averager::SaveNormalizedDistribution(const char *filename, int x, float range)
{
assert(x < fNx);
FILE *f = fopen(filename, "wt");
if (!f)
return 0;
fprintf(f, "X, Y, Z, Min, Max, Ave, Sigma\n");
for (int y=0 ; y<fNy ; y++)
for (int z=0 ; z<fNz ; z++) {
int nIndex = (x*fNy + y)*fNz + z;
int aIndex = ((x*fNy + y)*fNz + z) * fDim;
if (fN[nIndex] > 1) {
fprintf(f, "%d,%d, %d, ", x, y, z);
double s = 0;
double s2 = 0;
double min = 0;
double max = 0;
int n = fN[nIndex];
double m = Median(x, y, z);
for (int i=0 ; i<n ; i++) {
double v = fArray[aIndex + i] - m;
s += v;
s2 += v*v;
if (v < min)
min = v;
if (v > max)
max = v;
}
double sigma = sqrt((n * s2 - s * s) / (n * (n-1)));
double average = s / n;
fprintf(f, "%3.1lf, %3.1lf, %3.1lf, %3.3lf, ", min, max, average, sigma);
if (min < -range || max > range) {
for (int i=0 ; i<n ; i++)
fprintf(f, "%3.1lf,", fArray[aIndex + i] - m);
}
fprintf(f, "\n");
}
}
fclose(f);
return 1;
}
+700
View File
@@ -0,0 +1,700 @@
/********************************************************************\
Name: musbstd.c
Created by: Konstantin Olchanski, Stefan Ritt
Contents: Midas USB access
$Id$
\********************************************************************/
#include <stdio.h>
#include <assert.h>
#include <musbstd.h>
#ifdef _MSC_VER // Windows includes
#include <windows.h>
#include <conio.h>
#include <winioctl.h>
#include <setupapi.h>
#include <initguid.h> /* Required for GUID definition */
// link with SetupAPI.Lib.
#pragma comment (lib, "setupapi.lib")
// disable "deprecated" warning
#pragma warning( disable: 4996)
// {CBEB3FB1-AE9F-471c-9016-9B6AC6DCD323}
DEFINE_GUID(GUID_CLASS_MSCB_BULK, 0xcbeb3fb1, 0xae9f, 0x471c, 0x90, 0x16, 0x9b, 0x6a, 0xc6, 0xdc, 0xd3, 0x23);
#elif defined(OS_DARWIN)
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <fcntl.h>
#include <assert.h>
#include <mach/mach.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/usb/IOUSBLib.h>
#elif defined(OS_LINUX) // Linux includes
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#endif
#ifdef HAVE_LIBUSB
#include <errno.h>
#include <usb.h>
#endif
#ifdef HAVE_LIBUSB10
#include <errno.h>
#include <libusb-1.0/libusb.h>
#endif
#if !defined(HAVE_LIBUSB) && !defined(HAVE_LIBUSB10)
#ifdef OS_DARWIN
IOReturn darwin_configure_device(MUSB_INTERFACE* musb)
{
IOReturn status;
io_iterator_t iter;
io_service_t service;
IOCFPlugInInterface **plugin;
SInt32 score;
IOUSBInterfaceInterface **uinterface;
UInt8 numend;
IOUSBDeviceInterface **device = (IOUSBDeviceInterface **)musb->device;
status = (*device)->SetConfiguration(device, musb->usb_configuration);
assert(status == kIOReturnSuccess);
IOUSBFindInterfaceRequest request;
request.bInterfaceClass = kIOUSBFindInterfaceDontCare;
request.bInterfaceSubClass = kIOUSBFindInterfaceDontCare;
request.bInterfaceProtocol = kIOUSBFindInterfaceDontCare;
request.bAlternateSetting = kIOUSBFindInterfaceDontCare;
status = (*device)->CreateInterfaceIterator(device, &request, &iter);
assert(status == kIOReturnSuccess);
while ((service = IOIteratorNext(iter))) {
int i;
status =
IOCreatePlugInInterfaceForService(service, kIOUSBInterfaceUserClientTypeID,
kIOCFPlugInInterfaceID, &plugin, &score);
assert(status == kIOReturnSuccess);
status =
(*plugin)->QueryInterface(plugin, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID),
(void *) &uinterface);
assert(status == kIOReturnSuccess);
status = (*uinterface)->USBInterfaceOpen(uinterface);
fprintf(stderr, "musb_open: USBInterfaceOpen status 0x%x\n", status);
assert(status == kIOReturnSuccess);
status = (*uinterface)->GetNumEndpoints(uinterface, &numend);
assert(status == kIOReturnSuccess);
fprintf(stderr, "musb_open: endpoints: %d\n", numend);
for (i=1; i<=numend; i++) {
status = (*uinterface)->GetPipeStatus(uinterface, i);
fprintf(stderr, "musb_open: pipe %d status: 0x%x\n", i, status);
#if 0
status = (*uinterface)->ClearPipeStall(uinterface, i);
fprintf(stderr, "musb_open: pipe %d ClearPipeStall() status: 0x%x\n", i, status);
status = (*uinterface)->ResetPipe(uinterface, i);
fprintf(stderr, "musb_open: pipe %d ResetPipe() status: 0x%x\n", i, status);
status = (*uinterface)->AbortPipe(uinterface, i);
fprintf(stderr, "musb_open: pipe %d AbortPipe() status: 0x%x\n", i, status);
#endif
}
musb->interface = uinterface;
return kIOReturnSuccess;
}
assert(!"Should never be reached!");
return -1;
}
#endif
#endif
int musb_open(MUSB_INTERFACE **musb_interface, int vendor, int product, int instance, int configuration, int usbinterface)
{
#if defined(HAVE_LIBUSB)
struct usb_bus *bus;
struct usb_device *dev;
int count = 0;
usb_init();
usb_find_busses();
usb_find_devices();
usb_set_debug(3);
for (bus = usb_get_busses(); bus; bus = bus->next)
for (dev = bus->devices; dev; dev = dev->next)
if (dev->descriptor.idVendor == vendor && dev->descriptor.idProduct == product) {
if (count == instance) {
int status;
usb_dev_handle *udev;
udev = usb_open(dev);
if (!udev) {
fprintf(stderr, "musb_open: usb_open() error\n");
return MUSB_ACCESS_ERROR;
}
status = usb_set_configuration(udev, configuration);
if (status < 0) {
fprintf(stderr, "musb_open: usb_set_configuration() error %d (%s)\n", status,
strerror(-status));
fprintf(stderr,
"musb_open: Found USB device 0x%04x:0x%04x instance %d, but cannot initialize it: please check permissions on \"/proc/bus/usb/%s/%s\" and \"/dev/bus/usb/%s/%s\"\n",
vendor, product, instance, bus->dirname, dev->filename, bus->dirname, dev->filename);
return MUSB_ACCESS_ERROR;
}
/* see if we have write access */
status = usb_claim_interface(udev, usbinterface);
if (status < 0) {
fprintf(stderr, "musb_open: usb_claim_interface() error %d (%s)\n", status,
strerror(-status));
#ifdef _MSC_VER
fprintf(stderr,
"musb_open: Found USB device 0x%04x:0x%04x instance %d, but cannot initialize it:\nDevice is probably used by another program\n",
vendor, product, instance);
#else
fprintf(stderr,
"musb_open: Found USB device 0x%04x:0x%04x instance %d, but cannot initialize it: please check permissions on \"/proc/bus/usb/%s/%s\"\n",
vendor, product, instance, bus->dirname, dev->filename);
#endif
return MUSB_ACCESS_ERROR;
}
*musb_interface = (MUSB_INTERFACE*)calloc(1, sizeof(MUSB_INTERFACE));
(*musb_interface)->dev = udev;
(*musb_interface)->usb_configuration = configuration;
(*musb_interface)->usb_interface = usbinterface;
return MUSB_SUCCESS;
}
count++;
}
return MUSB_NOT_FOUND;
#elif defined(HAVE_LIBUSB10)
static int first_call = 1;
libusb_device **dev_list;
libusb_device_handle *dev;
struct libusb_device_descriptor desc;
int status, i, n;
int count = 0;
if (first_call) {
first_call = 0;
libusb_init(NULL);
// libusb_set_debug(NULL, 3);
}
n = libusb_get_device_list(NULL, &dev_list);
for (i=0 ; i<n ; i++) {
status = libusb_get_device_descriptor(dev_list[i], &desc);
if (desc.idVendor == vendor && desc.idProduct == product) {
if (count == instance) {
status = libusb_open(dev_list[i], &dev);
if (status < 0) {
fprintf(stderr, "musb_open: libusb_open() error %d\n", status);
return MUSB_ACCESS_ERROR;
}
status = libusb_set_configuration(dev, configuration);
if (status < 0) {
fprintf(stderr, "musb_open: usb_set_configuration() error %d\n", status);
fprintf(stderr,
"musb_open: Found USB device 0x%04x:0x%04x instance %d, but cannot initialize it: please check permissions on \"/proc/bus/usb/%d/%d\" and \"/dev/bus/usb/%d/%d\"\n",
vendor, product, instance, libusb_get_bus_number(dev_list[i]), libusb_get_device_address(dev_list[i]), libusb_get_bus_number(dev_list[i]), libusb_get_device_address(dev_list[i]));
return MUSB_ACCESS_ERROR;
}
/* see if we have write access */
status = libusb_claim_interface(dev, usbinterface);
if (status < 0) {
fprintf(stderr, "musb_open: libusb_claim_interface() error %d\n", status);
#ifdef _MSC_VER
fprintf(stderr,
"musb_open: Found USB device 0x%04x:0x%04x instance %d, but cannot initialize it:\nDevice is probably used by another program\n",
vendor, product, instance);
#else
fprintf(stderr,
"musb_open: Found USB device 0x%04x:0x%04x instance %d, but cannot initialize it: please check permissions on \"/proc/bus/usb/%d/%d\"\n",
vendor, product, instance, libusb_get_bus_number(dev_list[i]), libusb_get_device_address(dev_list[i]));
#endif
return MUSB_ACCESS_ERROR;
}
*musb_interface = (MUSB_INTERFACE*)calloc(1, sizeof(MUSB_INTERFACE));
(*musb_interface)->dev = dev;
(*musb_interface)->usb_configuration = configuration;
(*musb_interface)->usb_interface = usbinterface;
return MUSB_SUCCESS;
}
count++;
}
}
libusb_free_device_list(dev_list, 1);
return MUSB_NOT_FOUND;
#elif defined(OS_DARWIN)
kern_return_t status;
io_iterator_t iter;
io_service_t service;
IOCFPlugInInterface **plugin;
SInt32 score;
IOUSBDeviceInterface **device;
UInt16 xvendor, xproduct;
int count = 0;
*musb_interface = calloc(1, sizeof(MUSB_INTERFACE));
status = IORegistryCreateIterator(kIOMasterPortDefault, kIOUSBPlane, kIORegistryIterateRecursively, &iter);
assert(status == kIOReturnSuccess);
while ((service = IOIteratorNext(iter))) {
status =
IOCreatePlugInInterfaceForService(service, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID,
&plugin, &score);
assert(status == kIOReturnSuccess);
status = IOObjectRelease(service);
assert(status == kIOReturnSuccess);
status =
(*plugin)->QueryInterface(plugin, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (void *) &device);
assert(status == kIOReturnSuccess);
status = (*plugin)->Release(plugin);
status = (*device)->GetDeviceVendor(device, &xvendor);
assert(status == kIOReturnSuccess);
status = (*device)->GetDeviceProduct(device, &xproduct);
assert(status == kIOReturnSuccess);
//fprintf(stderr, "musb_open: Found USB device: vendor 0x%04x, product 0x%04x\n", xvendor, xproduct);
if (xvendor == vendor && xproduct == product) {
if (count == instance) {
fprintf(stderr, "musb_open: Found USB device: vendor 0x%04x, product 0x%04x, instance %d\n", xvendor, xproduct, instance);
status = (*device)->USBDeviceOpen(device);
fprintf(stderr, "musb_open: USBDeviceOpen status 0x%x\n", status);
assert(status == kIOReturnSuccess);
(*musb_interface)->usb_configuration = configuration;
(*musb_interface)->usb_interface = usbinterface;
(*musb_interface)->device = (void*)device;
(*musb_interface)->interface = NULL;
status = darwin_configure_device(*musb_interface);
if (status == kIOReturnSuccess)
return MUSB_SUCCESS;
fprintf(stderr, "musb_open: USB device exists, but configuration fails!");
return MUSB_NOT_FOUND;
}
count++;
}
(*device)->Release(device);
}
return MUSB_NOT_FOUND;
#elif defined(_MSC_VER)
GUID guid;
HDEVINFO hDevInfoList;
SP_DEVICE_INTERFACE_DATA deviceInfoData;
PSP_DEVICE_INTERFACE_DETAIL_DATA functionClassDeviceData;
ULONG predictedLength, requiredLength;
int status;
char device_name[256], str[256];
*musb_interface = (MUSB_INTERFACE *)calloc(1, sizeof(MUSB_INTERFACE));
guid = GUID_CLASS_MSCB_BULK;
// Retrieve device list for GUID that has been specified.
hDevInfoList = SetupDiGetClassDevs(&guid, NULL, NULL, (DIGCF_PRESENT | DIGCF_DEVICEINTERFACE));
status = FALSE;
if (hDevInfoList != NULL) {
// Clear data structure
memset(&deviceInfoData, 0, sizeof(deviceInfoData));
deviceInfoData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
// retrieves a context structure for a device interface of a device information set.
if (SetupDiEnumDeviceInterfaces(hDevInfoList, 0, &guid, instance, &deviceInfoData)) {
// Must get the detailed information in two steps
// First get the length of the detailed information and allocate the buffer
// retrieves detailed information about a specified device interface.
functionClassDeviceData = NULL;
predictedLength = requiredLength = 0;
SetupDiGetDeviceInterfaceDetail(hDevInfoList, &deviceInfoData, NULL, // Not yet allocated
0, // Set output buffer length to zero
&requiredLength, // Find out memory requirement
NULL);
predictedLength = requiredLength;
functionClassDeviceData = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(predictedLength);
functionClassDeviceData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
// Second, get the detailed information
if (SetupDiGetDeviceInterfaceDetail(hDevInfoList,
&deviceInfoData, functionClassDeviceData,
predictedLength, &requiredLength, NULL)) {
// Save the device name for subsequent pipe open calls
strcpy(device_name, functionClassDeviceData->DevicePath);
free(functionClassDeviceData);
// Signal device found
status = TRUE;
} else
free(functionClassDeviceData);
}
}
// SetupDiDestroyDeviceInfoList() destroys a device information set
// and frees all associated memory.
SetupDiDestroyDeviceInfoList(hDevInfoList);
if (status) {
// Get the read handle
sprintf(str, "%s\\PIPE00", device_name);
(*musb_interface)->rhandle = CreateFile(str,
GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_WRITE | FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
if ((*musb_interface)->rhandle == INVALID_HANDLE_VALUE)
return MUSB_ACCESS_ERROR;
// Get the write handle
sprintf(str, "%s\\PIPE01", device_name);
(*musb_interface)->whandle = CreateFile(str,
GENERIC_WRITE | GENERIC_READ,
FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if ((*musb_interface)->whandle == INVALID_HANDLE_VALUE)
return MUSB_ACCESS_ERROR;
return MUSB_SUCCESS;
}
return MUSB_NOT_FOUND;
#endif
}
int musb_set_altinterface(MUSB_INTERFACE *musb_interface, int index)
{
#if defined (HAVE_LIBUSB)
int status;
status = usb_set_altinterface(musb_interface->dev, index);
if (status < 0)
fprintf(stderr, "musb_set_altinterface: usb_set_altinterface() error %d\n", status);
return status;
#else
return -1;
#endif
}
int musb_close(MUSB_INTERFACE *musb_interface)
{
#if defined(HAVE_LIBUSB)
int status;
status = usb_release_interface(musb_interface->dev, musb_interface->usb_interface);
if (status < 0)
fprintf(stderr, "musb_close: usb_release_interface() error %d\n", status);
#ifdef OS_LINUX // linux wants a reset, otherwise the device cannot be accessed next time
musb_reset(musb_interface);
#endif
status = usb_close(musb_interface->dev);
if (status < 0)
fprintf(stderr, "musb_close: usb_close() error %d\n", status);
#elif defined(HAVE_LIBUSB10)
int status;
status = libusb_release_interface(musb_interface->dev, musb_interface->usb_interface);
if (status < 0)
fprintf(stderr, "musb_close: libusb_release_interface() error %d\n", status);
#ifdef OS_LINUX // linux wants a reset, otherwise the device cannot be accessed next time
musb_reset(musb_interface);
#endif
libusb_close(musb_interface->dev);
#elif defined(OS_DARWIN)
IOReturn status;
IOUSBInterfaceInterface **interface = (IOUSBInterfaceInterface **)musb_interface->interface;
status = (*interface)->USBInterfaceClose(interface);
if (status != kIOReturnSuccess)
fprintf(stderr, "musb_close: USBInterfaceClose() status %d 0x%x\n", status, status);
status = (*interface)->Release(interface);
if (status != kIOReturnSuccess)
fprintf(stderr, "musb_close: USB Interface Release() status %d 0x%x\n", status, status);
IOUSBDeviceInterface **device = (IOUSBDeviceInterface**)musb_interface->device;
status = (*device)->USBDeviceClose(device);
if (status != kIOReturnSuccess)
fprintf(stderr, "musb_close: USBDeviceClose() status %d 0x%x\n", status, status);
status = (*device)->Release(device);
if (status != kIOReturnSuccess)
fprintf(stderr, "musb_close: USB Device Release() status %d 0x%x\n", status, status);
#elif defined(_MSC_VER)
CloseHandle(musb_interface->rhandle);
CloseHandle(musb_interface->whandle);
#else
assert(!"musb_close() is not implemented");
#endif
/* free memory allocated in musb_open() */
free(musb_interface);
return 0;
}
int musb_write(MUSB_INTERFACE *musb_interface, int endpoint, const void *buf, int count, int timeout)
{
int n_written;
#if defined(HAVE_LIBUSB)
n_written = usb_bulk_write(musb_interface->dev, endpoint, (char*)buf, count, timeout);
if (n_written != count) {
fprintf(stderr, "musb_write: requested %d, wrote %d, errno %d (%s)\n", count, n_written, errno, strerror(errno));
}
#elif defined(HAVE_LIBUSB10)
int status = libusb_bulk_transfer(musb_interface->dev, endpoint, (unsigned char*)buf, count, &n_written, timeout);
if (n_written != count) {
fprintf(stderr, "musb_write: requested %d, wrote %d, errno %d (%s)\n", count, n_written, status, strerror(status));
}
#elif defined(OS_DARWIN)
IOReturn status;
IOUSBInterfaceInterface182 **interface = (IOUSBInterfaceInterface182 **)musb_interface->interface;
status = (*interface)->WritePipeTO(interface, endpoint, buf, count, 0, timeout);
if (status != 0) {
fprintf(stderr, "musb_write: WritePipe() status %d 0x%x\n", status, status);
return -1;
}
n_written = count;
#elif defined(_MSC_VER)
WriteFile(musb_interface->whandle, buf, count, &n_written, NULL);
#endif
//fprintf(stderr, "musb_write(ep %d, %d bytes) (%s) returns %d\n", endpoint, count, buf, n_written);
return n_written;
}
int musb_read(MUSB_INTERFACE *musb_interface, int endpoint, void *buf, int count, int timeout)
{
int n_read = 0;
#if defined(HAVE_LIBUSB)
n_read = usb_bulk_read(musb_interface->dev, endpoint | 0x80, (char*)buf, count, timeout);
/* errors should be handled in upper layer ....
if (n_read <= 0) {
fprintf(stderr, "musb_read: requested %d, read %d, errno %d (%s)\n", count, n_read, errno, strerror(errno));
}
*/
#elif defined(HAVE_LIBUSB10)
libusb_bulk_transfer(musb_interface->dev, endpoint | 0x80, (unsigned char*)buf, count, &n_read, timeout);
/* errors should be handled in upper layer ....
if (n_read <= 0) {
fprintf(stderr, "musb_read: requested %d, read %d, errno %d (%s)\n", count, n_read, status, strerror(status));
}
*/
#elif defined(OS_DARWIN)
UInt32 xcount = count;
IOReturn status;
IOUSBInterfaceInterface182 **interface = (IOUSBInterfaceInterface182 **)musb_interface->interface;
status = (*interface)->ReadPipeTO(interface, endpoint, buf, &xcount, 0, timeout);
if (status != kIOReturnSuccess) {
fprintf(stderr, "musb_read: requested %d, read %d, ReadPipe() status %d 0x%x (%s)\n", count, n_read, status, status, strerror(status));
return -1;
}
n_read = xcount;
#elif defined(_MSC_VER)
OVERLAPPED overlapped;
int status;
memset(&overlapped, 0, sizeof(overlapped));
overlapped.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
n_read = 0;
status = ReadFile(musb_interface->rhandle, buf, count, &n_read, &overlapped);
if (!status) {
status = GetLastError();
if (status != ERROR_IO_PENDING)
return 0;
/* wait for completion with timeout */
status = WaitForSingleObject(overlapped.hEvent, timeout);
if (status == WAIT_TIMEOUT)
CancelIo(musb_interface->rhandle);
else
GetOverlappedResult(musb_interface->rhandle, &overlapped, &n_read, FALSE);
}
CloseHandle(overlapped.hEvent);
#endif
//fprintf(stderr, "musb_read(ep %d, %d bytes) returns %d (%s)\n", endpoint, count, n_read, buf);
return n_read;
}
int musb_reset(MUSB_INTERFACE *musb_interface)
{
#if defined(HAVE_LIBUSB)
/* Causes re-enumeration: After calling usb_reset, the device will need
to re-enumerate and thusly, requires you to find the new device and
open a new handle. The handle used to call usb_reset will no longer work */
int status;
status = usb_reset(musb_interface->dev);
if (status < 0)
fprintf(stderr, "musb_reset: usb_reset() status %d\n", status);
#elif defined(HAVE_LIBUSB10)
int status;
status = libusb_reset_device(musb_interface->dev);
if (status < 0)
fprintf(stderr, "musb_reset: usb_reset() status %d\n", status);
#elif defined(OS_DARWIN)
IOReturn status;
IOUSBDeviceInterface **device = (IOUSBDeviceInterface**)musb_interface->device;
status = (*device)->ResetDevice(device);
fprintf(stderr, "musb_reset: ResetDevice() status 0x%x\n", status);
status = darwin_configure_device(musb_interface);
assert(status == kIOReturnSuccess);
#elif defined(_MSC_VER)
#define IOCTL_BULKUSB_RESET_DEVICE CTL_CODE(FILE_DEVICE_UNKNOWN, \
1, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
#define IOCTL_BULKUSB_RESET_PIPE CTL_CODE(FILE_DEVICE_UNKNOWN, \
2, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
int status, n_bytes;
status = DeviceIoControl(musb_interface->rhandle,
IOCTL_BULKUSB_RESET_DEVICE,
NULL, 0, NULL, 0, &n_bytes, NULL);
status = DeviceIoControl(musb_interface->whandle,
IOCTL_BULKUSB_RESET_DEVICE,
NULL, 0, NULL, 0, &n_bytes, NULL);
status = DeviceIoControl(musb_interface->rhandle,
IOCTL_BULKUSB_RESET_PIPE,
NULL, 0, NULL, 0, &n_bytes, NULL);
status = DeviceIoControl(musb_interface->whandle,
IOCTL_BULKUSB_RESET_PIPE,
NULL, 0, NULL, 0, &n_bytes, NULL);
return status;
#endif
return 0;
}
int musb_get_device(MUSB_INTERFACE *usb_interface)
{
#ifdef HAVE_LIBUSB
struct usb_device_descriptor d;
usb_get_descriptor(usb_interface->dev, USB_DT_DEVICE, 0, &d, sizeof(d));
return d.bcdDevice;
#elif HAVE_LIBUSB10
struct libusb_device_descriptor d;
libusb_get_descriptor(usb_interface->dev, LIBUSB_DT_DEVICE, 0, (unsigned char *)&d, sizeof(d));
return d.bcdDevice;
#else
return 0;
#endif
}
/* end */
+2366
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More