This repository was archived by the owner on Jul 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
48 changed files
with
1,695 additions
and
17 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
63 changes: 63 additions & 0 deletions
63
Assets/Scripts/Hakoniwa/PluggableAsset/Communication/Pdu/Accessor/Ev3PduActuatorAccessor.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,63 @@ | ||
using Hakoniwa.PluggableAsset.Communication.Pdu; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hakoniwa.PluggableAsset.Communication.Pdu.Accessor | ||
{ | ||
class Ev3PduActuatorAccessor | ||
{ | ||
private Pdu pdu; | ||
private Ev3PduActuatorHeaderAccessor pdu_head_accessor; | ||
private Ev3PduMotorAccessor[] pdu_motors_array_accessor; | ||
|
||
public Ev3PduActuatorAccessor(Pdu pdu) | ||
{ | ||
this.pdu = pdu; | ||
this.pdu_head_accessor = new Ev3PduActuatorHeaderAccessor(pdu.Ref("head")); | ||
var pdu_motors_array = pdu.Refs("motors"); | ||
for (int i = 0; i < pdu_motors_array.Length; i++) | ||
{ | ||
this.pdu_motors_array_accessor[i] = new Ev3PduMotorAccessor(pdu_motors_array[i]); | ||
} | ||
} | ||
public Ev3PduActuatorHeaderAccessor head | ||
{ | ||
set | ||
{ | ||
pdu_head_accessor = value; | ||
} | ||
get | ||
{ | ||
return pdu_head_accessor; | ||
} | ||
} | ||
public Byte[] leds | ||
{ | ||
get | ||
{ | ||
return pdu.GetDataUInt8Array("leds"); | ||
} | ||
} | ||
public Ev3PduMotorAccessor[] motors | ||
{ | ||
get | ||
{ | ||
return pdu_motors_array_accessor; | ||
} | ||
} | ||
public UInt32 gyro_reset | ||
{ | ||
set | ||
{ | ||
pdu.SetData("gyro_reset", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("gyro_reset"); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...Scripts/Hakoniwa/PluggableAsset/Communication/Pdu/Accessor/Ev3PduActuatorAccessor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
...cripts/Hakoniwa/PluggableAsset/Communication/Pdu/Accessor/Ev3PduActuatorHeaderAccessor.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,74 @@ | ||
using Hakoniwa.PluggableAsset.Communication.Pdu; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hakoniwa.PluggableAsset.Communication.Pdu.Accessor | ||
{ | ||
class Ev3PduActuatorHeaderAccessor | ||
{ | ||
private Pdu pdu; | ||
|
||
public Ev3PduActuatorHeaderAccessor(Pdu pdu) | ||
{ | ||
this.pdu = pdu; | ||
} | ||
public string name | ||
{ | ||
set | ||
{ | ||
pdu.SetData("name", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataString("name"); | ||
} | ||
} | ||
public UInt32 version | ||
{ | ||
set | ||
{ | ||
pdu.SetData("version", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("version"); | ||
} | ||
} | ||
public Int64 asset_time | ||
{ | ||
set | ||
{ | ||
pdu.SetData("asset_time", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataInt64("asset_time"); | ||
} | ||
} | ||
public UInt32 ext_off | ||
{ | ||
set | ||
{ | ||
pdu.SetData("ext_off", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("ext_off"); | ||
} | ||
} | ||
public UInt32 ext_size | ||
{ | ||
set | ||
{ | ||
pdu.SetData("ext_size", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("ext_size"); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...s/Hakoniwa/PluggableAsset/Communication/Pdu/Accessor/Ev3PduActuatorHeaderAccessor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
...s/Scripts/Hakoniwa/PluggableAsset/Communication/Pdu/Accessor/Ev3PduColorSensorAccessor.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,74 @@ | ||
using Hakoniwa.PluggableAsset.Communication.Pdu; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Hakoniwa.PluggableAsset.Communication.Pdu.Accessor | ||
{ | ||
class Ev3PduColorSensorAccessor | ||
{ | ||
private Pdu pdu; | ||
|
||
public Ev3PduColorSensorAccessor(Pdu pdu) | ||
{ | ||
this.pdu = pdu; | ||
} | ||
public UInt32 color | ||
{ | ||
set | ||
{ | ||
pdu.SetData("color", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("color"); | ||
} | ||
} | ||
public UInt32 reflect | ||
{ | ||
set | ||
{ | ||
pdu.SetData("reflect", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("reflect"); | ||
} | ||
} | ||
public UInt32 rgb_r | ||
{ | ||
set | ||
{ | ||
pdu.SetData("rgb_r", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("rgb_r"); | ||
} | ||
} | ||
public UInt32 rgb_g | ||
{ | ||
set | ||
{ | ||
pdu.SetData("rgb_g", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("rgb_g"); | ||
} | ||
} | ||
public UInt32 rgb_b | ||
{ | ||
set | ||
{ | ||
pdu.SetData("rgb_b", value); | ||
} | ||
get | ||
{ | ||
return pdu.GetDataUInt32("rgb_b"); | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ipts/Hakoniwa/PluggableAsset/Communication/Pdu/Accessor/Ev3PduColorSensorAccessor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.