Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
seto77 committed Jun 30, 2024
1 parent 9f785ba commit c4292aa
Show file tree
Hide file tree
Showing 52 changed files with 3,264 additions and 3,372 deletions.
4 changes: 2 additions & 2 deletions CSManager/CSManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<AssemblyVersion>2024.3.2.1232</AssemblyVersion>
<FileVersion>2024.3.2.1232</FileVersion>
<AssemblyVersion>2024.6.30.0309</AssemblyVersion>
<FileVersion>2024.6.30.0309</FileVersion>
<ApplicationIcon>App.ico</ApplicationIcon>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
</PropertyGroup>
Expand Down
Binary file modified CSManager/StdDb.cdb3
Binary file not shown.
Binary file added CSManager/StdDb_old.cdb3
Binary file not shown.
3 changes: 1 addition & 2 deletions Crystallography.Controls/CheckLocation.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using static System.Net.WebRequestMethods;

namespace Crystallography.Controls
{
Expand All @@ -11,7 +10,7 @@ public static void Adjust(Form form)
{
double fL = form.Bounds.Left, fR = form.Bounds.Right, fT = form.Bounds.Top, fB = form.Bounds.Bottom, fW = form.Size.Width, fH = form.Size.Height;

if (Screen.AllScreens.All(s => (fL - s.Bounds.Left) / fW < -0.8 || (s.Bounds.Right- fR) / fW < -0.8 || (fT - s.Bounds.Top) / fH < -0.8 || (s.Bounds.Bottom - fB) / fH < -0.8))
if (Screen.AllScreens.All(s => (fL - s.Bounds.Left) / fW < -0.8 || (s.Bounds.Right - fR) / fW < -0.8 || (fT - s.Bounds.Top) / fH < -0.8 || (s.Bounds.Bottom - fB) / fH < -0.8))
{
var scr = Screen.AllScreens.First(e => e.DeviceName == Screen.FromControl(form).DeviceName);
form.Location = new Point(scr.Bounds.X + 100, scr.Bounds.Y + 100);
Expand Down
4 changes: 2 additions & 2 deletions Crystallography.Controls/Crystal/BoundControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventA
}
#endregion






}
4 changes: 2 additions & 2 deletions Crystallography.Controls/Crystal/CrystalControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,14 @@ public void toAnotherSpaceGroup(int destNum)
"-b1" => forward ? (-z, y, x) : (z, y, -x),
"-b2" => forward ? (x + z, y, z) : (x - z, y, z),
"-b3" => forward ? (-x, y, -z - x) : (-x, y, x - z),

"c1" => forward ? (z, x, y) : (y, z, x),
"c2" => forward ? (x - z, -z, y) : (x - y, z, -y),
"c3" => forward ? (-x, z - x, y) : (-x, z, y - x),
"-c1" => forward ? (x, -z, y) : (x, z, -y),
"-c2" => forward ? (z, x + z, y) : (y - x, z, x),
"-c3" => forward ? (-z - x, -x, y) : (-y, z, y - x),

"a1" => forward ? (y, z, x) : (z, x, y),
"a2" => forward ? (y, x - z, -z) : (y - z, x, -z),
"a3" => forward ? (y, -x, z - x) : (-y, x, z - y),
Expand Down
4,794 changes: 2,397 additions & 2,397 deletions Crystallography.Controls/Crystal/CrystalControl.resx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Crystallography.Controls/Crystal/FormAnotherSpaceGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class FormAnotherSpaceGroup : Form
}
}
public int SeriesNum => candidates[listBox.SelectedIndex].SeriesNum;


public FormAnotherSpaceGroup()
{
Expand Down
2 changes: 1 addition & 1 deletion Crystallography.Controls/Crystal/FormScatteringFactor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void SetSortedPlanes()

c.SetVectorOfG((double)numericUpDownThresholdD.Value / 10, waveLengthControl1.WaveSource, false);

Array.Sort(c.VectorOfG,(g1, g2) => g2.d.CompareTo(g1.d));
Array.Sort(c.VectorOfG, (g1, g2) => g2.d.CompareTo(g1.d));

if (c.VectorOfG.Length == 0) return;

Expand Down
2 changes: 1 addition & 1 deletion Crystallography.Controls/Crystal/SymmetryControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public void SetCellConstantsBySymmetry()

ItemChanged?.Invoke(this, new EventArgs());
//GenerateFromInterface();

}
#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private void backgroundWorkerSearch_RunWorkerCompleted(object sender, System.Com
//if (flagCount == 0)
// CrystalDatabaseControl.Suspend();
//else
CrystalDatabaseControl.Resume();//バインディングを繋げる
CrystalDatabaseControl.Resume();//バインディングを繋げる


this.Enabled = true;
Expand Down
41 changes: 0 additions & 41 deletions Crystallography.Controls/Crystallography - Backup.Controls.csproj

This file was deleted.

5 changes: 2 additions & 3 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.2.1232</AssemblyVersion>
<FileVersion>2024.3.2.1232</FileVersion>
<AssemblyVersion>2024.6.30.0309</AssemblyVersion>
<FileVersion>2024.6.30.0309</FileVersion>
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
<ApplicationUseCompatibleTextRendering>true</ApplicationUseCompatibleTextRendering>
<ApplicationVisualStyles>true</ApplicationVisualStyles>
Expand Down Expand Up @@ -33,7 +33,6 @@
<ItemGroup>
<PackageReference Include="IronPython" Version="3.4.1" />
<PackageReference Include="SimdLinq" Version="1.3.2" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions Crystallography.Controls/GraphControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public GraphControl()
#endregion イベント

#region プロパティ、フィールド

/// <summary>
/// グラフの描き方の列挙体
/// </summary>
public enum DrawingMode { Line, Histogram, Point }

private Bitmap Bmp;
private Graphics G;

Expand Down Expand Up @@ -1270,8 +1270,8 @@ private void pictureBox_MouseMove(object sender, MouseEventArgs e)
{
if (verticalLineList.Count > selectedVerticalLineIndex && selectedVerticalLineIndex >= 0)
{
//lineList[selectedLineIndex].X = x;
verticalLineList[selectedVerticalLineIndex] = new PointD(pt.X, verticalLineList[selectedVerticalLineIndex].Y);
var x = XLog ? Math.Pow(10,pt.X) : pt.X;
verticalLineList[selectedVerticalLineIndex] = new PointD(x, verticalLineList[selectedVerticalLineIndex].Y);

Draw();
LinePositionChanged?.Invoke();
Expand Down
2 changes: 1 addition & 1 deletion Crystallography.Controls/Macro/FormMacro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void RunMacro(string srcCode)
}

_cancelSource = new CancellationTokenSource();
task = new Task(()=> Engine.CreateScriptSourceFromString(srcCode).Execute(Scope), _cancelSource.Token);
task = new Task(() => Engine.CreateScriptSourceFromString(srcCode).Execute(Scope), _cancelSource.Token);
task.RunSynchronously();
}
catch (Microsoft.Scripting.ArgumentTypeException ex) { MessageBox.Show(ex.Message); }
Expand Down
12 changes: 6 additions & 6 deletions Crystallography.Controls/ScalablePictureBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public PseudoBitmap PseudoBitmap
public bool TitleVisible { get; set; } = false;
public (string Text, Font Font, Color Color1, Color Color2) Title { get; set; }


#endregion プロパティ

/// <summary>
Expand Down Expand Up @@ -507,12 +507,12 @@ private void pictureBox_MouseDown(object sender, MouseEventArgs e)
_Center = ConvertToSrcPt(e.Location);//イベントを起こさないように小文字のcenterに代入
Zoom *= 0.5f;
}
else if ((e.Button == MouseButtons.Left||e.Button== MouseButtons.Middle) && e.Clicks == 1)
else if ((e.Button == MouseButtons.Left || e.Button == MouseButtons.Middle) && e.Clicks == 1)
{
justBeforePoint = e.Location;
}
}


private bool manualSpotMode = false;

Expand All @@ -535,7 +535,7 @@ private void pictureBox_MouseMove(object sender, MouseEventArgs e)
mouseRangeEnd = e.Location;
pictureBox.Refresh();
}
else if ((e.Button == MouseButtons.Left||e.Button == MouseButtons.Middle) && MouseTranslation && justBeforePoint != e.Location)
else if ((e.Button == MouseButtons.Left || e.Button == MouseButtons.Middle) && MouseTranslation && justBeforePoint != e.Location)
{
Center = new PointD(Center.X + (justBeforePoint.X - e.Location.X) / Zoom, Center.Y + (justBeforePoint.Y - e.Location.Y) / Zoom);
justBeforePoint = e.Location;
Expand Down Expand Up @@ -1018,13 +1018,13 @@ public Bitmap GetBitmapImage()
public void SaveAsPNG()
{
var dlg = new SaveFileDialog() { Filter = "*.png|*.png" };
if(dlg.ShowDialog()== DialogResult.OK)
if (dlg.ShowDialog() == DialogResult.OK)
GetBitmapImage().Save(dlg.FileName);
}

public void CopyAsBitmap()
{
Clipboard.SetDataObject(GetBitmapImage(),true);
Clipboard.SetDataObject(GetBitmapImage(), true);
}

public void SaveAsMetafile() => metafile(true);
Expand Down
11 changes: 9 additions & 2 deletions Crystallography.Controls/Wave/WaveLengthControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions Crystallography.Controls/Wave/WaveLengthControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ public FlowDirection Direction

public bool Monochrome
{
set
{ numericBoxEnergy.Visible = numericBoxWaveLength.Visible = value;
flowLayoutPanelElement.Visible = WaveSource == WaveSource.Xray && value;
labelFlatWhite.Visible = !value; }
set
{
numericBoxEnergy.Visible = numericBoxWaveLength.Visible = value;
flowLayoutPanelElement.Visible = WaveSource == WaveSource.Xray && value;
labelFlatWhite.Visible = !value;
}
get => numericBoxEnergy.Visible;
}

[Localizable(true)]
[Localizable(true)]
public Font TextFont
{
set
Expand Down Expand Up @@ -280,7 +282,7 @@ public WaveLengthControl()
comboBoxXRayElement.SelectedIndex = 0;
}



/// <summary>
/// X線のElementが変更されたとき
Expand Down
Loading

0 comments on commit c4292aa

Please sign in to comment.