-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63b909f
commit 4a8bf14
Showing
7 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using FastMember; | ||
using TypeWrapping; | ||
|
||
namespace BveTypes.ClassWrappers | ||
{ | ||
/// <summary> | ||
/// 再粘着制御を表します。 | ||
/// </summary> | ||
public class ReAdhesionControl : ClassWrapperBase | ||
{ | ||
[InitializeClassWrapper] | ||
private static void Initialize(BveTypeSet bveTypes) | ||
{ | ||
ClassMemberSet members = bveTypes.GetClassInfoOf<ReAdhesionControl>(); | ||
|
||
ModeGetMethod = members.GetSourcePropertyGetterOf(nameof(Mode)); | ||
|
||
IsEnabledGetMethod = members.GetSourcePropertyGetterOf(nameof(IsEnabled)); | ||
IsEnabledSetMethod = members.GetSourcePropertySetterOf(nameof(IsEnabled)); | ||
} | ||
|
||
/// <summary> | ||
/// オリジナル オブジェクトから <see cref="ReAdhesionControl"/> クラスの新しいインスタンスを初期化します。 | ||
/// </summary> | ||
/// <param name="src">ラップするオリジナル オブジェクト。</param> | ||
protected ReAdhesionControl(object src) : base(src) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// オリジナル オブジェクトからラッパーのインスタンスを生成します。 | ||
/// </summary> | ||
/// <param name="src">ラップするオリジナル オブジェクト。</param> | ||
/// <returns>オリジナル オブジェクトをラップした <see cref="ReAdhesionControl"/> クラスのインスタンス。</returns> | ||
[CreateClassWrapperFromSource] | ||
public static ReAdhesionControl FromSource(object src) => src is null ? null : new ReAdhesionControl(src); | ||
|
||
private static FastMethod ModeGetMethod; | ||
/// <summary> | ||
/// 再粘着制御の動作状態を取得します。 | ||
/// </summary> | ||
public ReAdhesionControlMode Mode => (ReAdhesionControlMode)ModeGetMethod.Invoke(Src, null); | ||
|
||
private static FastMethod IsEnabledGetMethod; | ||
private static FastMethod IsEnabledSetMethod; | ||
/// <summary> | ||
/// 再粘着制御を使用するかどうかを取得・設定します。 | ||
/// </summary> | ||
public bool IsEnabled | ||
{ | ||
get => IsEnabledGetMethod.Invoke(Src, null); | ||
set => IsEnabledSetMethod.Invoke(Src, new object[] { value }); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Libs/BveTypes/ClassWrappers/Public/ReAdhesionControlMode.cs
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,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace BveTypes.ClassWrappers | ||
{ | ||
/// <summary> | ||
/// 再粘着制御の動作状態を指定します。 | ||
/// </summary> | ||
public enum ReAdhesionControlMode | ||
{ | ||
/// <summary> | ||
/// 再粘着制御を動作させないことを指定します。 | ||
/// </summary> | ||
Disable, | ||
|
||
/// <summary> | ||
/// 電流または圧力を引き下げることを指定します。 | ||
/// </summary> | ||
Reduce, | ||
|
||
/// <summary> | ||
/// 低い電流または圧力のまま維持することを指定します。 | ||
/// </summary> | ||
Hold, | ||
|
||
/// <summary> | ||
/// 引き下げた電流または圧力を元に戻すことを指定します。 | ||
/// </summary> | ||
Return, | ||
} | ||
} |
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