Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion WasatchNET/COMOCTSpectrometer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal override async Task<bool> openAsync()
}
catch (Exception)
{
return false;
return false;
}

bool openBase = await base.openAsync();
Expand All @@ -86,6 +86,7 @@ internal override async Task<bool> openAsync()
}

testPattern = 0;
testPatternHeight = eeprom.activePixelsVert;

eeprom.featureMask.PropertyChanged += FeatureMask_PropertyChanged;
eeprom.featureMask.invertXAxis = false;
Expand Down Expand Up @@ -113,6 +114,14 @@ public async override Task closeAsync()
port = null;
}

public override void saveUserSettings()
{
string resp = "";
bool ok = sendCOMCommand(Opcodes.SET_USER_SETTINGS, ref resp, new float[] { 1 }, new int[] { 0 });
if (ok)
logger.debug("User settings save response: {0}", resp.Split('\r')[0].Trim());
}

public override string firmwareRevision
{
get
Expand Down Expand Up @@ -247,6 +256,30 @@ public override int testPattern
}
}

public override int testPatternHeight
{
get
{
return testPatternHeight_;
}
set
{
int prevValue = testPatternHeight_;
string resp = "";
bool ok = sendCOMCommand(Opcodes.SET_TEST_HEIGHT, ref resp, new float[] { value }, new int[] { 0 });
if (ok)
{
ok = sendCOMCommand(Opcodes.GET_TEST_HEIGHT, ref resp, null);

if (ok)
testPatternHeight_ = System.Convert.ToInt32(resp.Split('\r')[0]);
else
testPatternHeight_ = prevValue;
}
}
}


public override float linePeriod
{
get
Expand Down
3 changes: 3 additions & 0 deletions WasatchNET/IOpcodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public enum Opcodes
GET_OPT_LASER_TYPE,
GET_SELECTED_ADC,
GET_TEST_PATTERN,
GET_TEST_HEIGHT,
GET_TRIGGER_DELAY,
GET_TRIGGER_OUTPUT,
GET_TRIGGER_SOURCE,
Expand Down Expand Up @@ -122,9 +123,11 @@ public enum Opcodes
SET_MODEL_CONFIG_FX2,
SET_SELECTED_ADC,
SET_TEST_PATTERN,
SET_TEST_HEIGHT,
SET_TRIGGER_DELAY,
SET_TRIGGER_OUTPUT,
SET_TRIGGER_SOURCE,
SET_USER_SETTINGS,
WRITE_LIBRARY,
PROCESS_LIBRARY,
}
Expand Down
3 changes: 3 additions & 0 deletions WasatchNET/Opcodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public Dictionary<Opcodes, string> getDict()
cmd[Opcodes.GET_INTEGRATION_TIME ] = "r tint";
cmd[Opcodes.GET_LINE_PERIOD ] = "r tper";
cmd[Opcodes.GET_TEST_PATTERN ] = "r srce";
cmd[Opcodes.SET_TEST_HEIGHT ] = "r tsth";
cmd[Opcodes.GET_MODEL_CONFIG ] = "r deid";
cmd[Opcodes.GET_FIRMWARE_REVISION ] = "r dfwv";
cmd[Opcodes.GET_OCT_ANALOG_GAIN ] = "r pamp";
Expand All @@ -225,6 +226,8 @@ public Dictionary<Opcodes, string> getDict()
cmd[Opcodes.SET_INTEGRATION_TIME ] = "w tint";
cmd[Opcodes.SET_LINE_PERIOD ] = "w tper";
cmd[Opcodes.SET_TEST_PATTERN ] = "w srce";
cmd[Opcodes.SET_TEST_HEIGHT ] = "w tsth";
cmd[Opcodes.SET_USER_SETTINGS ] = "w scfg";
cmd[Opcodes.SET_OCT_ANALOG_GAIN ] = "w pamp";
cmd[Opcodes.SET_DETECTOR_GAIN ] = "w gain";
cmd[Opcodes.SET_DETECTOR_OFFSET ] = "w offs";
Expand Down
18 changes: 18 additions & 0 deletions WasatchNET/WPOCTSpectrometer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ public override ushort[] getFrame(bool direct = true)

public override bool resetFPGA() => true;

public virtual void saveUserSettings()
{

}

public override string serialNumber
{
get { return eeprom.serialNumber; }
Expand Down Expand Up @@ -526,6 +531,19 @@ public virtual int testPattern
}
protected int testPattern_ = 0;

public virtual int testPatternHeight
{
get
{
return testPatternHeight_;
}
set
{
testPatternHeight_ = value;
}
}
protected int testPatternHeight_ = 0;

public virtual float linePeriod
{
get
Expand Down
Binary file modified lib/x64/WasatchNET.dll
Binary file not shown.
Binary file modified lib/x86/WasatchNET.dll
Binary file not shown.