Skip to content

Commit

Permalink
Add split spectrum into fg,bg list button
Browse files Browse the repository at this point in the history
  • Loading branch information
Am6er committed Oct 3, 2024
1 parent 6c50b95 commit a381dae
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 88 deletions.
5 changes: 3 additions & 2 deletions BecquerelMonitor/BecquerelMonitor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<MinimumRequiredVersion>2022.07.08.7</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>index.html</WebPage>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationVersion>2024.10.02.3</ApplicationVersion>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>2024.10.03.1</ApplicationVersion>
<UseApplicationTrust>true</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -1175,6 +1175,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Resources\split.bmp" />
<None Include="Resources\save.bmp" />
<None Include="Resources\RefreshBG.bmp" />
<None Include="Resources\NORM.bmp" />
Expand Down
11 changes: 10 additions & 1 deletion BecquerelMonitor/DocEnergySpectrum.Designer.cs

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

28 changes: 26 additions & 2 deletions BecquerelMonitor/DocEnergySpectrum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ public bool UpdateSpectrum
}
}

public bool UpdateSpectrumList
{
get
{
return this.updateSpectrumList;
}
set
{
this.updateSpectrumList = value;
}
}

public bool UpdateDetectedPeaks
{
get
Expand Down Expand Up @@ -337,9 +349,10 @@ private void SetupBGAffinityButtons()
{
bool isBGexists = this.IsBackgroundExists();
this.toolStripRefreshBgButton.Enabled = isBGexists;
this.toolStripSplitButton.Enabled = isBGexists && this.ResultDataFile.ResultDataList.Count == 1;
}

private void SetupSaveDocumentButtons()
private void SetupSaveDocumentButton()
{
this.toolStripSaveButton.Enabled = this.Dirty;
}
Expand Down Expand Up @@ -534,7 +547,7 @@ public void RefreshView()
this.EvaluateNormByEffMode();
this.view.PrepareViewData();
this.SetupBGAffinityButtons();
this.SetupSaveDocumentButtons();
this.SetupSaveDocumentButton();
this.DocumentTextWithDirtyFlag();
this.view.RecalcScrollBar();
this.view.Invalidate();
Expand Down Expand Up @@ -1380,6 +1393,15 @@ void toolStripSaveButton_Click(object sender, EventArgs e)

}

void toolStripSplitButton_Click(object sender, EventArgs e)
{
DocumentManager.GetInstance().SplitDocEnergySpectrum(this);
this.UpdateMeasurementResult = true;
this.UpdateSpectrum = true;
this.UpdateSpectrumList = true;
this.UpdateEnergySpectrum();
}

void toolStripNumUpDownScale_ValueChanged(object sender, EventArgs e)
{
this.view.zoom(this.toolStripNumUpDownScale.NumericUpDownControl.Value);
Expand Down Expand Up @@ -1487,6 +1509,8 @@ void DocEnergySpectrum_MouseUp(object sender, MouseEventArgs e)

bool updateDoseRate = false;

bool updateSpectrumList = false;

// Token: 0x04000153 RID: 339
bool activeEnergyCalibration;

Expand Down
3 changes: 3 additions & 0 deletions BecquerelMonitor/DocEnergySpectrum.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1126,4 +1126,7 @@
<data name="toolStripSaveButton.ToolTipText" xml:space="preserve">
<value>Save current document</value>
</data>
<data name="toolStripSplitButton.ToolTipText" xml:space="preserve">
<value>Split active document into foreground and background spectrum list</value>
</data>
</root>
3 changes: 3 additions & 0 deletions BecquerelMonitor/DocEnergySpectrum.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -807,4 +807,7 @@
<data name="toolStripSaveButton.ToolTipText" xml:space="preserve">
<value>Сохранить текущий документ</value>
</data>
<data name="toolStripSplitButton.ToolTipText" xml:space="preserve">
<value>Отделить фон от спектра и представить в виде списка спектров</value>
</data>
</root>
25 changes: 25 additions & 0 deletions BecquerelMonitor/DocumentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,31 @@ public void LoadBackgroundSpectrum(ResultData resultData)
}
}

public void SplitDocEnergySpectrum(DocEnergySpectrum doc)
{
ResultData resultData = doc.ActiveResultData.Clone();
resultData.EnergySpectrum = resultData.BackgroundEnergySpectrum.Clone();
resultData.SampleInfo.Name = Path.GetFileNameWithoutExtension(resultData.BackgroundSpectrumFile);
resultData.MeasurementController = doc.ActiveResultData.MeasurementController;
resultData.ROIConfig = doc.ActiveResultData.ROIConfig;
resultData.ROIConfigReference = doc.ActiveResultData.ROIConfigReference;
resultData.ResultDataStatus = doc.ActiveResultData.ResultDataStatus.Clone();
resultData.ResultDataStatus.TotalTime = TimeSpan.FromSeconds(resultData.EnergySpectrum.MeasurementTime);
resultData.ResultDataStatus.ElapsedTime = TimeSpan.FromSeconds(resultData.EnergySpectrum.MeasurementTime);
resultData.ResultDataStatus.TimeInSamples = resultData.EnergySpectrum.NumberOfSamples;
resultData.BackgroundEnergySpectrum = null;
resultData.BackgroundSpectrumFile = "";
resultData.BackgroundSpectrumPathname = "";
resultData.Dirty = true;
doc.ResultDataFile.ResultDataList.Add(resultData);
if (doc.ActiveResultData.SampleInfo.Name == "") doc.ActiveResultData.SampleInfo.Name = Path.GetFileNameWithoutExtension(doc.Filename);
doc.ActiveResultData.BackgroundEnergySpectrum = null;
doc.ActiveResultData.BackgroundSpectrumFile = "";
doc.ActiveResultData.BackgroundSpectrumPathname = "";
//doc.ActiveResultDataIndex = doc.ResultDataFile.ResultDataList.Count - 1;
doc.Dirty = true;
}

// Token: 0x06000278 RID: 632 RVA: 0x0000A4F8 File Offset: 0x000086F8
public void ExportDocumentToCsv(DocEnergySpectrum doc)
{
Expand Down
5 changes: 5 additions & 0 deletions BecquerelMonitor/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ void OnTimer(object sender, EventArgs e)
this.ShowMeasurementResult(false);
this.activeDocument.UpdateMeasurementResult = false;
}
if (this.activeDocument != null && this.activeDocument.UpdateSpectrumList)
{
this.UpdateSpectrumListView();
this.activeDocument.UpdateSpectrumList = false;
}
}
this.count200 += 100;
if (this.count200 >= 200)
Expand Down
4 changes: 2 additions & 2 deletions BecquerelMonitor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyVersion("2024.10.02.3")]
[assembly: AssemblyVersion("2024.10.03.1")]
[assembly: AssemblyProduct("BecquerelMonitor")]
[assembly: AssemblyCopyright("free")]
[assembly: AssemblyTrademark("none")]
[assembly: AssemblyConfiguration("")]
[assembly: Guid("40110b38-4882-47c1-ad94-a71e58dcb5f8")]
[assembly: AssemblyFileVersion("2024.10.02.3")]
[assembly: AssemblyFileVersion("2024.10.03.1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("free")]
[assembly: CompilationRelaxations(8)]
Expand Down
20 changes: 10 additions & 10 deletions BecquerelMonitor/Properties/Resources.Designer.cs

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

70 changes: 3 additions & 67 deletions BecquerelMonitor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -8506,73 +8506,6 @@ http://xptable.sourceforge.net/</value>
<data name="MSGClearSpectrum" xml:space="preserve">
<value>Clear spectrum?</value>
</data>
<data name="ベクモニロゴ" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAMYAAAAiCAYAAAAETqbJAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAAAAd0SU1FB9wKBwcmFKIEFzAAAA40SURBVHhe7ZwJrBXVGceVVRZlB9EqAWQHBVEE
BFlKFIQENFgrjQsoKotC0RA1pVYNrcSi9AkWSQGbSBGMYAJ0ERURCYUCVlS0bLEKFncWARV4p///d78z
npkz9zH3vrk+0ftL/tyzfN+ZuffNN3O24ZQiRYoUKVKkSJEiP3iMMXdAnzh6HV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bD7J4qY2kypKnE0h5BJXn4scuHgX9FNffPFF
GWRzDxrfy+B4jJ+8Wd16663BS2kKg6Ix2hOQLgZGFJwEp10lOBw4Wg6mQJHmtK3A+W9ubeckwIYNG0Jv
Byrc4jkGqq7u5QZtsesnK8TsO/OFqj59+gQv/dMkiX5I4PvwCzE4VkpBcrhSGwQFQV4u5nISCoxyUvGB
QXAiDA4Gg5W3LoAy+X+kssDn8x+hXmqeOmib+34kOMqLtvedkuYx2ZYLin4Kcc2CK3ycbuJkhf1/pTj3
y3LWD1AXD9SV54IOXcjIp9bWSQFO2l3s+wfESQBu7P9OFthwHAYH91/z/4Kx/7FYTmhTRYoUKVKkSJEi
RYr8eDjllP8DhiwnfPhnsowAAAAASUVORK5CYII=
</value>
</data>
<data name="MSGThermometerTypeChanging" xml:space="preserve">
<value>Changing thermometer type causes initialization of input fields. OK?</value>
</data>
Expand Down Expand Up @@ -41984,4 +41917,7 @@ see peak in spectrum now).</value>
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="split" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\split.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file added BecquerelMonitor/Resources/split.bmp
Binary file not shown.
1 change: 1 addition & 0 deletions BecquerelMonitor/ResultData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ public ResultData Clone()
resultData.ROIConfig = this.ROIConfig;
resultData.StartTime = this.StartTime;
resultData.EndTime = this.EndTime;
resultData.PresetTime = this.PresetTime;
resultData.BackgroundEnergySpectrum = this.BackgroundEnergySpectrum.Clone();
resultData.BackgroundSpectrumFile = this.BackgroundSpectrumFile;
resultData.BackgroundSpectrumPathname = this.BackgroundSpectrumPathname;
Expand Down
4 changes: 0 additions & 4 deletions BecquerelMonitor/StartupForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ public StartupForm()
this.InitializeComponent();
base.Icon = Resources.becqmoni;
CultureInfo currentUICulture = Thread.CurrentThread.CurrentUICulture;
if (this.label5.Text.StartsWith("起動"))
{
this.panel2.BackgroundImage = Resources.ベクモニロゴ;
}
this.textBox1.HideSelection = false;
GlobalConfigManager instance = GlobalConfigManager.GetInstance();
this.label3.Text = string.Format(Resources.VersionString, instance.VersionString) + " ";
Expand Down

0 comments on commit a381dae

Please sign in to comment.