Skip to content

Commit f841986

Browse files
committed
updated docs, WinFormDemo (laserPowerSetpointMW)
1 parent 7e447bd commit f841986

File tree

8 files changed

+980
-710
lines changed

8 files changed

+980
-710
lines changed

Doxyfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -494,13 +494,13 @@ EXTRACT_PRIVATE = YES
494494
# methods of a class will be included in the documentation.
495495
# The default value is: NO.
496496

497-
EXTRACT_PRIV_VIRTUAL = NO
497+
EXTRACT_PRIV_VIRTUAL = YES
498498

499499
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
500500
# scope will be included in the documentation.
501501
# The default value is: NO.
502502

503-
EXTRACT_PACKAGE = NO
503+
EXTRACT_PACKAGE = YES
504504

505505
# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
506506
# included in the documentation.
@@ -522,7 +522,7 @@ EXTRACT_LOCAL_CLASSES = YES
522522
# included.
523523
# The default value is: NO.
524524

525-
EXTRACT_LOCAL_METHODS = NO
525+
EXTRACT_LOCAL_METHODS = YES
526526

527527
# If this flag is set to YES, the members of anonymous namespaces will be
528528
# extracted and appear in the documentation as a namespace called
@@ -531,7 +531,7 @@ EXTRACT_LOCAL_METHODS = NO
531531
# are hidden.
532532
# The default value is: NO.
533533

534-
EXTRACT_ANON_NSPACES = NO
534+
EXTRACT_ANON_NSPACES = YES
535535

536536
# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
537537
# undocumented members inside documented classes or files. If set to NO these

README_CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Wasatch.NET Changelog
22

3+
- 2021-05-28 2.3.29
4+
- updated docs
5+
- strengthened EEPROM.hasLaserPowerCalibration
6+
- updated WinFormDemo with tabbed controls and laserPowerMW
37
- 2021-05-18 2.3.28
48
- added user configurable field to control how long temperatures are cached
59
- 2021-04-12 2.3.27

WasatchNET/EEPROM.cs

+20-2
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,22 @@ public EEPROMJSON toJSON()
16541654
return json;
16551655
}
16561656

1657-
1657+
/// <summary>
1658+
/// Reports whether the Spectrometer's EEPROM contains four valid
1659+
/// coefficients for converting a requested output power setpoint in
1660+
/// milliWatts into the calibrated fractional PWM duty cycle as a
1661+
/// percentage of full (continuous) power.
1662+
/// </summary>
1663+
///
1664+
/// <remarks>
1665+
/// All this does is confirm that four floating-point values were
1666+
/// successfully demarshalled from the appropriate 16 bytes of the EEPROM
1667+
/// page, and that at least one of them is non-zero and positive. It
1668+
/// does not guarantee that the floats together represent an accurate
1669+
/// laser power calibration for the current spectrometer.
1670+
/// </remarks>
1671+
///
1672+
/// <returns>whether a seeming-valid calibration was found</returns>
16581673
public bool hasLaserPowerCalibration()
16591674
{
16601675
if (maxLaserPowerMW <= 0)
@@ -1663,11 +1678,14 @@ public bool hasLaserPowerCalibration()
16631678
if (laserPowerCoeffs is null || laserPowerCoeffs.Length < 4)
16641679
return false;
16651680

1681+
bool onePos = false;
16661682
foreach (double d in laserPowerCoeffs)
16671683
if (Double.IsNaN(d))
16681684
return false;
1685+
else if (d > 0)
1686+
onePos = true;
16691687

1670-
return true;
1688+
return onePos;
16711689
}
16721690

16731691
protected void enforceReasonableDefaults()

WinFormDemo/Form1.Designer.cs

+581-358
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WinFormDemo/Form1.cs

+19
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,22 @@ void updateCurrentSpectrometer()
192192
numericUpDownLaserPowerPerc.Enabled =
193193
checkBoxLaserEnable.Enabled = true;
194194
checkBoxLaserEnable.Checked = currentSpectrometer.laserEnabled;
195+
196+
if (currentSpectrometer.eeprom.hasLaserPowerCalibration())
197+
{
198+
numericUpDownLaserPowerMW.Enabled = true;
199+
numericUpDownLaserPowerMW.Maximum = (decimal)currentSpectrometer.eeprom.maxLaserPowerMW;
200+
numericUpDownLaserPowerMW.Minimum = (decimal)currentSpectrometer.eeprom.minLaserPowerMW;
201+
}
202+
else
203+
{
204+
numericUpDownLaserPowerMW.Enabled = false;
205+
}
195206
}
196207
else
197208
{
198209
numericUpDownLaserPowerPerc.Enabled =
210+
numericUpDownLaserPowerMW.Enabled =
199211
checkBoxLaserEnable.Enabled =
200212
checkBoxLaserEnable.Checked = false;
201213
}
@@ -622,6 +634,12 @@ private void numericUpDownLaserPowerPerc_ValueChanged(object sender, EventArgs e
622634
currentSpectrometer.setLaserPowerPercentage(((float)numericUpDownLaserPowerPerc.Value) / 100.0f);
623635
}
624636

637+
private void numericUpDownLaserPowerMW_ValueChanged(object sender, EventArgs e)
638+
{
639+
if (currentSpectrometer != null)
640+
currentSpectrometer.laserPowerSetpointMW = (float)numericUpDownLaserPowerMW.Value;
641+
}
642+
625643
private void numericUpDownDetectorSetpointDegC_ValueChanged(object sender, EventArgs e)
626644
{
627645
if (currentSpectrometer != null)
@@ -894,5 +912,6 @@ void doComplete(Spectrometer spectrometer)
894912
logger.debug("shutdown still pending %s", string.Join(", ", waitList));
895913
}
896914
}
915+
897916
}
898917
}

0 commit comments

Comments
 (0)