Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
seto77 committed Mar 15, 2024
1 parent d220bc8 commit cb7ab5d
Show file tree
Hide file tree
Showing 9 changed files with 6,239 additions and 5,918 deletions.
4 changes: 2 additions & 2 deletions Crystallography.Controls/Crystallography.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<OutputType>Library</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<AssemblyVersion>2024.3.11.0541</AssemblyVersion>
<FileVersion>2024.3.11.0541</FileVersion>
<AssemblyVersion>2024.3.15.2210</AssemblyVersion>
<FileVersion>2024.3.15.2210</FileVersion>
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
<ApplicationUseCompatibleTextRendering>true</ApplicationUseCompatibleTextRendering>
<ApplicationVisualStyles>true</ApplicationVisualStyles>
Expand Down
4 changes: 2 additions & 2 deletions Crystallography.OpenGL/Crystallography.OpenGL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<OutputType>Library</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<AssemblyVersion>2024.3.11.0541</AssemblyVersion>
<FileVersion>2024.3.11.0541</FileVersion>
<AssemblyVersion>2024.3.15.2210</AssemblyVersion>
<FileVersion>2024.3.15.2210</FileVersion>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions Crystallography/Crystallography.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<OutputType>Library</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<AssemblyVersion>2024.3.11.0541</AssemblyVersion>
<FileVersion>2024.3.11.0541</FileVersion>
<AssemblyVersion>2024.3.15.2210</AssemblyVersion>
<FileVersion>2024.3.15.2210</FileVersion>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
</PropertyGroup>

Expand Down
196 changes: 98 additions & 98 deletions ReciPro/DiffractionSimulator/FormDiffractionSimulator.Designer.cs

Large diffs are not rendered by default.

32 changes: 23 additions & 9 deletions ReciPro/DiffractionSimulator/FormDiffractionSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public double Resolution
{
set
{
var val = radioButtonResoUnitNanometerInv.Checked ?
WaveLength / 2.0 / Math.Sin(Math.Atan(value / CameraLength2) / 2.0) : value;
var val = radioButtonResoUnitMilliMeter.Checked ? value:
2.0 * Math.Sin(Math.Atan(value / CameraLength2) / 2.0) / WaveLength;

skipDrawing = true;
if (val > numericBoxResolution.Maximum)
Expand All @@ -154,10 +154,28 @@ public double Resolution
if (radioButtonResoUnitMilliMeter.Checked)//単位がmm/pixの時はそのまま返す
return numericBoxResolution.Value;
else//単位が nm^-1/pixの時
return CameraLength2 * Math.Tan(2 * Math.Asin(WaveLength / numericBoxResolution.Value / 2.0));
return CameraLength2 * Math.Tan(2 * Math.Asin(WaveLength * numericBoxResolution.Value / 2.0));

}
}
public LengthUnitEnum ResolutionUnit
{
get => radioButtonResoUnitMilliMeter.Checked ? LengthUnitEnum.MilliMeter : LengthUnitEnum.NanoMeterInverse;
set
{
if (value == LengthUnitEnum.MilliMeter)
{
radioButtonResoUnitNanometerInv.Checked = false;
radioButtonResoUnitMilliMeter.Checked = true;
}
else
{
radioButtonResoUnitMilliMeter.Checked = false;
radioButtonResoUnitNanometerInv.Checked = true;
}
}
}

public int ClientWidth { get => numericBoxClientWidth.ValueInteger; set => numericBoxClientWidth.Value = value; }
public int ClientHeight { get => numericBoxClientHeight.ValueInteger; set => numericBoxClientHeight.Value = value; }

Expand Down Expand Up @@ -2922,16 +2940,12 @@ private void radioButtonResoUnit_CheckedChanged(object sender, EventArgs e)

if (radioButtonResoUnitMilliMeter.Checked)
{
numericBoxResolution.Maximum = 1E1;
numericBoxResolution.Minimum = 1E-5;
numericBoxResolution.Value = Math.Tan(2 * Math.Asin(WaveLength / val / 2.0)) * CameraLength2;
numericBoxResolution.Value = CameraLength2 * Math.Tan(2 * Math.Asin(WaveLength * val / 2.0)) ;

}
else
{
numericBoxResolution.Maximum = 1E7;
numericBoxResolution.Minimum = 1E-3;
numericBoxResolution.Value = WaveLength / 2.0 / Math.Sin( Math.Atan(val / CameraLength2) /2.0 );
numericBoxResolution.Value = 2.0 * Math.Sin(Math.Atan(val / CameraLength2) / 2.0) / WaveLength;
}
SkipEvent = false;

Expand Down
Loading

0 comments on commit cb7ab5d

Please sign in to comment.