Permalink
Browse files

changes 19.10.18

  • Loading branch information...
teodor-krastev committed Oct 19, 2018
1 parent e6cb931 commit 0e8637d5cc9c4964ab982a327f024de23f96e4c1
Showing with 3,845 additions and 8,885 deletions.
  1. +6 −5 Axel-hub/Axel-hub/Axel-hub.csproj
  2. +20 −20 Axel-hub/Axel-hub/AxelHMems.cs
  3. +13 −4 Axel-hub/Axel-hub/MOTMasterDataConverter.cs
  4. +110 −61 Axel-hub/Axel-hub/MainWindow.xaml
  5. +565 −155 Axel-hub/Axel-hub/MainWindow.xaml.cs
  6. +14 −1 Axel-hub/Axel-hub/{ → Options}/Options.xaml
  7. +13 −0 Axel-hub/Axel-hub/{ → Options}/Options.xaml.cs
  8. +0 −3 Axel-hub/Axel-hub/Properties/licenses.licx
  9. +1 −1 Axel-hub/config/Defaults.cfg
  10. +1 −1 Axel-hub/config/genOptions.cfg
  11. +22 −0 Axel-hub/scanUC.new/scanUC.sln
  12. +55 −0 Axel-hub/scanUC.new/scanUC/Properties/AssemblyInfo.cs
  13. +2 −2 {Axel-track → Axel-hub/scanUC.new/scanUC}/Properties/Resources.Designer.cs
  14. 0 {Axel-track-4Jonas → Axel-hub/scanUC.new/scanUC}/Properties/Resources.resx
  15. +1 −1 {Axel-track-4Jonas → Axel-hub/scanUC.new/scanUC}/Properties/Settings.Designer.cs
  16. +7 −0 Axel-hub/scanUC.new/scanUC/Properties/Settings.settings
  17. +7 −0 Axel-hub/scanUC/scanUC/Properties/licenses.licx
  18. +4 −1 Axel-hub/scanUC/scanUC/scanHub.csproj
  19. +13 −12 Axel-hub/scanUC/scanUC/scanUC.xaml
  20. +58 −44 Axel-hub/scanUC/scanUC/scanUC.xaml.cs
  21. +55 −48 Axel-probe/Axel-probe/MainWindow.xaml
  22. +213 −94 Axel-probe/Axel-probe/MainWindow.xaml.cs
  23. +6 −0 Axel-show/App.config
  24. +8 −0 Axel-show/App.xaml
  25. +17 −0 Axel-show/App.xaml.cs
  26. +137 −0 Axel-show/Axel-show.csproj
  27. BIN Axel-show/MS14_Background.png
  28. +135 −0 Axel-show/MainWindow.xaml
  29. +524 −0 Axel-show/MainWindow.xaml.cs
  30. +55 −0 Axel-show/Properties/AssemblyInfo.cs
  31. +26 −18 {Axel-track-4Jonas → Axel-show}/Properties/Resources.Designer.cs
  32. 0 {Axel-track → Axel-show}/Properties/Resources.resx
  33. +13 −9 {Axel-track → Axel-show}/Properties/Settings.Designer.cs
  34. +7 −0 Axel-show/Properties/Settings.settings
  35. +8 −0 Axel-show/Properties/licenses.licx
  36. BIN Axel-show/partBG.jpg
  37. BIN Axel-show/peacock1_FZe_icon.ico
  38. +6 −0 Axel-tilt/App.config
  39. +8 −0 Axel-tilt/App.xaml
  40. +17 −0 Axel-tilt/App.xaml.cs
  41. +133 −0 Axel-tilt/Axel-tilt.csproj
  42. +178 −0 Axel-tilt/MainWindow.xaml
  43. +478 −0 Axel-tilt/MainWindow.xaml.cs
  44. +7 −0 Axel-tilt/Properties/licenses.licx
  45. +630 −0 Axel-tilt/Tilt.cs
  46. BIN Axel-tilt/Tilt2.png
  47. +0 −161 Axel-track-4Jonas/Axel-track-4Jonas.csproj
  48. +0 −878 Axel-track-4Jonas/Form1.Designer.cs
  49. +0 −1,082 Axel-track-4Jonas/Form1.cs
  50. +0 −1,581 Axel-track-4Jonas/Form1.resx
  51. +0 −373 Axel-track-4Jonas/Program.cs
  52. +0 −36 Axel-track-4Jonas/Properties/AssemblyInfo.cs
  53. +0 −7 Axel-track-4Jonas/Properties/Settings.settings
  54. +0 −5 Axel-track-4Jonas/Properties/licenses.licx
  55. BIN Axel-track-4Jonas/Properties/train1.ico
  56. +0 −3 Axel-track-4Jonas/app.config
  57. +0 −161 Axel-track/Axel-track.csproj
  58. BIN Axel-track/Axel-track.jpg
  59. +0 −34 Axel-track/Axel-track.sln
  60. +0 −690 Axel-track/Form1.Designer.cs
  61. +0 −1,077 Axel-track/Form1.cs
  62. +0 −1,581 Axel-track/Form1.resx
  63. +0 −373 Axel-track/Program.cs
  64. +0 −36 Axel-track/Properties/AssemblyInfo.cs
  65. +0 −7 Axel-track/Properties/Settings.settings
  66. +0 −5 Axel-track/Properties/licenses.licx
  67. BIN Axel-track/Properties/train1.ico
  68. +0 −3 Axel-track/app.config
  69. +0 −129 Axel-track/config/stages.ini
  70. BIN Axel-track/train1.png
  71. BIN Axel-track/train2.png
  72. +62 −51 AxelChart/AxelChart/AxelChartUC.xaml
  73. +141 −74 AxelChart/AxelChart/AxelChartUC.xaml.cs
  74. +18 −36 AxelSuite.sln
  75. +19 −3 Utils/OptionsType.cs
  76. +29 −17 Utils/RemoteMessaging.cs
  77. +3 −2 Utils/UtilsLib.cs
@@ -28,7 +28,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.3.0.%2a</ApplicationVersion>
<ApplicationVersion>1.4.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@@ -62,12 +62,12 @@
<HintPath>..\..\..\EDMSuite\MotMaster2\bin\Nav\DataStructures.dll</HintPath>
</Reference>
<Reference Include="NationalInstruments.Analysis.Enterprise, Version=15.0.45.49153, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" />
<Reference Include="NationalInstruments.Common, Version=15.1.40.49152, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=MSIL" />
<Reference Include="NationalInstruments.Common, Version=17.5.40.49153, Culture=neutral, PublicKeyToken=dc6ad606294fc298, processorArchitecture=MSIL" />
<Reference Include="NationalInstruments.Controls, Version=15.0.45.3898, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" />
<Reference Include="NationalInstruments.Controls.Booleans, Version=15.0.45.3898, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" />
<Reference Include="NationalInstruments.Controls.Graphs, Version=15.0.45.3898, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" />
<Reference Include="NationalInstruments.Controls.Numerics, Version=15.0.45.3898, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL" />
<Reference Include="NationalInstruments.DAQmx, Version=15.5.45.109, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=x86" />
<Reference Include="NationalInstruments.DAQmx, Version=17.6.45.181, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=x86" />
<Reference Include="NationalInstruments.Net, Version=15.0.45.49153, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=x86">
<Private>False</Private>
</Reference>
@@ -125,7 +125,7 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Options.xaml">
<Page Include="Options\Options.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -135,7 +135,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="MOTMasterDataConverter.cs" />
<Compile Include="Options.xaml.cs">
<Compile Include="Options\Options.xaml.cs">
<DependentUpon>Options.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
@@ -188,6 +188,7 @@
<Name>AxelChart</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -6,14 +6,13 @@

using NationalInstruments;
using NationalInstruments.DAQmx;
//using DS345NS;
using UtilsNS;

namespace AxelHMemsNS
{
public class AxelMems
{
public Timer mTimer = null; // start/stop

private Stopwatch sw = null;
public bool AdjustTimelineToStopwatch = false; // false - use the set time interval between points
// true - adjust the time interval to stopwatch markers
@@ -29,12 +28,9 @@ public enum TimingModes { byNone, byADCtimer, byStopwatch, byBoth };
private readonly string physicalChannel1 = "cDAQ1Mod1/ai1";
private readonly string physicalChannel2 = "Dev4/ai1"; //PXIe

private int _nSamples = 1500; // default
public int nSamples {get { return _nSamples; } }

private double _sampleRate = 2133;
public double sampleRate { get { return _sampleRate; } }
public int Timeout = 1000; // [sec]
public int nSamples { get; private set; }
public double sampleRate { get; private set; }
public int Timeout = -1; // [sec] ; -1 - no timeout
public List<double> rawData = null;

private Task voltageInputTask = null;
@@ -51,6 +47,8 @@ public AxelMems()
{
sw = new Stopwatch();
activeChannel = 0;
sampleRate = 2133;
nSamples = 1500;
}

public double TimeElapsed() // [sec]
@@ -66,7 +64,7 @@ public AxelMems()
get { return _running; }
}

public int activeChannel { get; private set; } // 0,1 or 2 for both; 3 for chn.1 of PXIe
public int activeChannel { get; set; } // 0,1 or 2 for both; 3 for chn.1 of PXIe

public double RealConvRate(double wantedCR)
{
@@ -108,16 +106,16 @@ public double RealConvRate(double wantedCR)
return aiData;
}

public void configureVITask(string physicalChn, int numbSamples, double samplingRate)
public void configureVITask(string physicalChn, int numbSamples, double samplingRate) // obsolete, but good to have as how to configure acquisition task
{
if(Utils.isNull(voltageInputTask)) voltageInputTask = new Task();

if(Utils.isNull(axelAIChannel)) axelAIChannel = voltageInputTask.AIChannels.CreateVoltageChannel(physicalChn, "", AITerminalConfiguration.Differential,
(double)-3.5, (double)3.5, AIVoltageUnits.Volts);

voltageInputTask.Timing.ConfigureSampleClock("", sampleRate, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples);
voltageInputTask.Timing.SamplesPerChannel = nSamples;
voltageInputTask.Stream.Timeout = 1000 * Timeout;
voltageInputTask.Timing.SamplesPerChannel = numbSamples;
voltageInputTask.Stream.Timeout = Timeout;
voltageInputTask.Control(TaskAction.Commit);

if(Utils.isNull(VIReader)) VIReader = new AnalogMultiChannelReader(voltageInputTask.Stream);
@@ -150,22 +148,24 @@ public void StartAqcuisition(int samplesPerChannel, double samplingRate)
{
try
{
if (runningTask == null)
if (Utils.isNull(runningTask))
{
// Create a new task
myTask = new Task();

// Create a virtual channel
if ((activeChannel == 0) || (activeChannel == 2))
myTask.AIChannels.CreateVoltageChannel(physicalChannel0, "", (AITerminalConfiguration)(-1), -3.5, 3.5, AIVoltageUnits.Volts);
if ((activeChannel == 1) || (activeChannel == 2))
myTask.AIChannels.CreateVoltageChannel(physicalChannel1, "", (AITerminalConfiguration)(-1), -3.5, 3.5, AIVoltageUnits.Volts);
if ((activeChannel == 0) || (activeChannel == 2))
myTask.AIChannels.CreateVoltageChannel(physicalChannel0, "", AITerminalConfiguration.Differential, -3.5, 3.5, AIVoltageUnits.Volts);
if ((activeChannel == 1) || (activeChannel == 2))
myTask.AIChannels.CreateVoltageChannel(physicalChannel1, "", AITerminalConfiguration.Differential, -3.5, 3.5, AIVoltageUnits.Volts);
if (activeChannel == 3)
myTask.AIChannels.CreateVoltageChannel(physicalChannel2, "", (AITerminalConfiguration)(-1), -3.5, 3.5, AIVoltageUnits.Volts);
myTask.AIChannels.CreateVoltageChannel(physicalChannel2, "", AITerminalConfiguration.Differential, -3.5, 3.5, AIVoltageUnits.Volts);
}
// Configure the timing parameters
myTask.Stop();
myTask.Timing.ConfigureSampleClock("", samplingRate, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples, samplesPerChannel);
myTask.Timing.SamplesPerChannel = samplesPerChannel;
myTask.Stream.Timeout = Timeout;

// Verify the Task
myTask.Control(TaskAction.Verify);
@@ -180,8 +180,8 @@ public void StartAqcuisition(int samplesPerChannel, double samplingRate)
// marshals callbacks across threads appropriately.
analogInReader.SynchronizeCallbacks = true;
}
_nSamples = samplesPerChannel;
_sampleRate = RealConvRate(samplingRate);
nSamples = samplesPerChannel;
sampleRate = RealConvRate(samplingRate);
if (!sw.IsRunning)
{
sw.Start(); // first time
@@ -9,10 +9,11 @@
using Newtonsoft.Json.Linq;
using RemoteMessagingNS;
using OptionsNS;
using UtilsNS;

namespace Axel_hub
{
public static class MOTMasterDataConverter
public static class MMDataConverter
{
public static Dictionary<string, double> AverageShotSegments(MMexec data, bool initN2, bool stdDev)
{
@@ -50,7 +51,7 @@ public static void ConvertToDoubleArray(ref MMexec data)
Dictionary<string,object>tempDict = new Dictionary<string, object>();
foreach (var key in data.prms.Keys)
{
if (key == "runID" || key == "groupID" || key == "last") tempDict[key] = data.prms[key];
if (key == "runID" || key == "groupID" || key == "last" || key == "MEMS") tempDict[key] = data.prms[key];
else
{
var rawData = (JArray) data.prms[key];
@@ -65,8 +66,7 @@ public static void ConvertToDoubleArray(ref MMexec data)
return Asymmetry(AverageShotSegments(data, false,false), subtractBackground, subtractDark);
}

public static double Asymmetry(Dictionary<string, double> avgs, bool subtractBackground = true,
bool subtractDark = true)
public static double Asymmetry(Dictionary<string, double> avgs, bool subtractBackground = true, bool subtractDark = true)
{
var n2 = avgs["N2"];
var ntot = avgs["NTot"];
@@ -91,5 +91,14 @@ public static double IntegrateAcceleration(MMexec data)
{
throw new NotImplementedException();
}

public static double Restrict2twoPI(double phi)
{
double ph = phi;
if (ph <= 0) ph += 2 * Math.PI;
if (ph <= 0) ph += 2 * Math.PI;
if (Utils.InRange(ph, 0, 2 * Math.PI)) return ph;
return ph % (2 * Math.PI);
}
}
}
Oops, something went wrong.

0 comments on commit 0e8637d

Please sign in to comment.