Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [ifm] Fixes related to CameraSettingsControl. * readonly params: backgrounddistance & integrationtimemode * keep using existing MetriCam App & add exposure ratio property (only works in moderate exposure mode) * fix header offsets for newest ifm firmware & change ip address property to be more consistent with other camera implementations * all properties other than IP immutable when not connected & fix IP property desc * set parameters in connect impl only when creating a new application * throw exceptions when accessing properties when not connected Co-authored-by: sisiplac <simon.placht@metrilus.de>
- Loading branch information
1 parent
49ccd81
commit 40c7d71
Showing
8 changed files
with
323 additions
and
88 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Reflection; | ||
|
||
namespace MetriCam2.Cameras | ||
{ | ||
/// <summary> | ||
/// ifm O3D3xx Trigger Modes | ||
/// </summary> | ||
public enum O3D3xxTriggerMode | ||
{ | ||
FreeRun = 1, | ||
ProcessInterface = 2, | ||
PositiveEdge = 3, | ||
NegatigeEdge = 4, | ||
PositiveAndNegativeEdge = 5, | ||
} | ||
|
||
public enum O3D3xxIntegrationMode | ||
{ | ||
[Description("low")] | ||
SingleIntegrationTime = 0, | ||
[Description("moderate")] | ||
TwoIntegrationTimes = 1, | ||
[Description("high")] | ||
ThreeIntegrationTimes = 2, | ||
} | ||
|
||
public enum NonAmbiguityRange | ||
{ | ||
[Description("lessthan5m")] | ||
LessThan5 = 0, | ||
[Description("upto30m")] | ||
UpTo30 = 1, | ||
[Description("morethan30m")] | ||
MoreThan30 = 2, | ||
} | ||
|
||
public static class EnumUtils | ||
{ | ||
public static string GetDescription(this Enum value) | ||
{ | ||
Type type = value.GetType(); | ||
string name = Enum.GetName(type, value); | ||
if (name != null) | ||
{ | ||
FieldInfo field = type.GetField(name); | ||
if (field != null) | ||
{ | ||
DescriptionAttribute attr = | ||
Attribute.GetCustomAttribute(field, | ||
typeof(DescriptionAttribute)) as DescriptionAttribute; | ||
if (attr != null) | ||
{ | ||
return attr.Description; | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public static object GetEnum(Type type, string description) | ||
{ | ||
Array allValues = Enum.GetValues(type); | ||
foreach (Enum value in allValues) | ||
{ | ||
if(description == GetDescription(value)) | ||
{ | ||
return Enum.Parse(type, value.ToString()); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Metrilus GmbH | ||
// MetriCam 2 is licensed under the MIT license. See License.txt for full license text. | ||
|
||
using System; | ||
|
||
namespace MetriCam2.Exceptions | ||
{ | ||
public class NotConnectedException : MetriCam2Exception | ||
{ | ||
public NotConnectedException(string message) | ||
: base(message) | ||
{ } | ||
public NotConnectedException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters