Skip to content

Commit

Permalink
Add support for percent16/32 channel type in fatek binding.
Browse files Browse the repository at this point in the history
Swap readout process to source api through dedicated fatek sampler.

Signed-off-by: Łukasz Dywicki <luke@code-house.org>
  • Loading branch information
splatch committed Mar 5, 2024
1 parent e14058d commit 47e4e09
Show file tree
Hide file tree
Showing 36 changed files with 1,172 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
|===
|Channel type | Label ^|Description

| co7io-fatek:contact
| Contact
| A read only channel which represent state of input or output.

<<co7io-fatek:contact>>

| co7io-fatek:discrete
| Discrete register
| Discrete register of connected PLC.
| Switchable discrete register
| Discrete register of connected PLC which can be commanded.

<<co7io-fatek:discrete>>

Expand All @@ -23,6 +29,18 @@

<<co7io-fatek:data32>>

| co7io-fatek:percent16
| Percent (16-bit)
| Data register for representing percentage expressed as integer (0 ... 100) based on 16 bit register.

<<co7io-fatek:percent16>>

| co7io-fatek:percent32
| Percent (32-bit)
| Data register for representing percentage in range as integer or floating point number based on 32 bit register.

<<co7io-fatek:percent32>>

| co7io-fatek:rollershutter16
| Rollershutter (16-bit)
| Data register for position will use 16 bit registers.
Expand Down Expand Up @@ -50,6 +68,38 @@
|===


[[co7io-fatek:contact]]
== Configuration of `co7io-fatek:contact`

Below table contain configuration parameters which can be assigned to channels of type `co7io-fatek:contact`.

[width="100%",caption="Channel type contact configuration",cols="1,1,1,2"]
|===
|Name | Type | Label ^|Description

| register
| TEXT
| Register
| Type of discrete register to read or write.

| index
| INTEGER
| Register index
| Index of register used to retrieve data.

| invert
| BOOLEAN
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===


[[co7io-fatek:discrete]]
== Configuration of `co7io-fatek:discrete`

Expand All @@ -74,6 +124,11 @@ Below table contain configuration parameters which can be assigned to channels o
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===


Expand Down Expand Up @@ -101,6 +156,11 @@ Below table contain configuration parameters which can be assigned to channels o
| Unsigned
| Values retrieved from and written to device assume unsigned representation.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===


Expand All @@ -123,19 +183,62 @@ Below table contain configuration parameters which can be assigned to channels o
| Register index
| Index of register used to retrieve data.

| unsigned
| BOOLEAN
| Unsigned
| Values retrieved from and written to device assume unsigned representation. Does not apply if floating option is set.

| floating
| BOOLEAN
| floating point
| Indicate that read/write value is a floating point number. Overrides unsigned flag.

| step
| DECIMAL
| Step
| Value assumed for increase/decrease command.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===


[[co7io-fatek:percent16]]
== Configuration of `co7io-fatek:percent16`

Below table contain configuration parameters which can be assigned to channels of type `co7io-fatek:percent16`.

[width="100%",caption="Channel type percent16 configuration",cols="1,1,1,2"]
|===
|Name | Type | Label ^|Description

| register
| TEXT
| Register
| Type of data register to read or write.

| index
| INTEGER
| Register index
| Index of register used to retrieve data.

| step
| INTEGER
| Step
| Value assumed for increase/decrease command.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===


[[co7io-fatek:percent32]]
== Configuration of `co7io-fatek:percent32`

Below table contain configuration parameters which can be assigned to channels of type `co7io-fatek:percent32`.


[[co7io-fatek:rollershutter16]]
== Configuration of `co7io-fatek:rollershutter16`

Expand Down Expand Up @@ -195,6 +298,11 @@ Below table contain configuration parameters which can be assigned to channels o
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===


Expand Down Expand Up @@ -257,6 +365,11 @@ Below table contain configuration parameters which can be assigned to channels o
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===


Expand Down Expand Up @@ -299,11 +412,21 @@ Below table contain configuration parameters which can be assigned to channels o
| Register index
| Index of register used to retrieve data.

| step
| DECIMAL
| Step
| Value assumed for increase/decrease command.

| rgb
| BOOLEAN
| RGB mode
| Write and interpret read data as RGB code instead of HSB.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

| switcherRegister
| TEXT
| Register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@
| Register index
| Index of register used to retrieve data.

| unsigned
| BOOLEAN
| Unsigned
| Values retrieved from and written to device assume unsigned representation. Does not apply if floating option is set.

| floating
| BOOLEAN
| floating point
| Indicate that read/write value is a floating point number. Overrides unsigned flag.

| step
| DECIMAL
| Step
| Value assumed for increase/decrease command.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===

[[thing-type:co7io-fatek:tcp]]
Expand Down Expand Up @@ -114,6 +119,34 @@

|===

[[channel-type:co7io-fatek:contact]]
== Config `channel-type:co7io-fatek:contact`
[width="100%",caption="channel-type:co7io-fatek:contact configuration",cols="1,1,1,2"]
|===
|Name | Type | Label ^|Description

| register
| TEXT
| Register
| Type of discrete register to read or write.

| index
| INTEGER
| Register index
| Index of register used to retrieve data.

| invert
| BOOLEAN
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===

[[channel-type:co7io-fatek:binary]]
== Config `channel-type:co7io-fatek:binary`
[width="100%",caption="channel-type:co7io-fatek:binary configuration",cols="1,1,1,2"]
Expand All @@ -135,6 +168,39 @@
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===

[[channel-type:co7io-fatek:percent16]]
== Config `channel-type:co7io-fatek:percent16`
[width="100%",caption="channel-type:co7io-fatek:percent16 configuration",cols="1,1,1,2"]
|===
|Name | Type | Label ^|Description

| register
| TEXT
| Register
| Type of data register to read or write.

| index
| INTEGER
| Register index
| Index of register used to retrieve data.

| step
| INTEGER
| Step
| Value assumed for increase/decrease command.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===

[[channel-type:co7io-fatek:rollershutter32]]
Expand Down Expand Up @@ -193,6 +259,11 @@
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===

[[channel-type:co7io-fatek:data16]]
Expand All @@ -216,6 +287,11 @@
| Unsigned
| Values retrieved from and written to device assume unsigned representation.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===

[[channel-type:co7io-fatek:rollershutter16]]
Expand Down Expand Up @@ -274,6 +350,11 @@
| Invert
| Invert logical representation of related register (0->1, 1->0).

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

|===

[[channel-type:co7io-fatek:color16]]
Expand Down Expand Up @@ -312,11 +393,21 @@
| Register index
| Index of register used to retrieve data.

| step
| DECIMAL
| Step
| Value assumed for increase/decrease command.

| rgb
| BOOLEAN
| RGB mode
| Write and interpret read data as RGB code instead of HSB.

| refreshInterval
| INTEGER
| Refresh interval
| Time between next poll cycles, 0 assumes same value as Thing for which this channel is defined.

| switcherRegister
| TEXT
| Register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ public interface FatekBindingConstants extends BaseBindingConstants {
));

// common dynamic channel types
ChannelTypeUID CHANNEL_TYPE_CONTACT = new ChannelTypeUID(BINDING_ID, "contact");
ChannelTypeUID CHANNEL_TYPE_DISCRETE = new ChannelTypeUID(BINDING_ID, "discrete");
ChannelTypeUID CHANNEL_TYPE_DATA16 = new ChannelTypeUID(BINDING_ID, "data16");
ChannelTypeUID CHANNEL_TYPE_DATA32 = new ChannelTypeUID(BINDING_ID, "data32");
ChannelTypeUID CHANNEL_TYPE_PERCENT16 = new ChannelTypeUID(BINDING_ID, "percent16");
ChannelTypeUID CHANNEL_TYPE_PERCENT32 = new ChannelTypeUID(BINDING_ID, "percent32");
ChannelTypeUID CHANNEL_TYPE_ROLLERSHUTTER16 = new ChannelTypeUID(BINDING_ID, "rollershutter16");
ChannelTypeUID CHANNEL_TYPE_ROLLERSHUTTER32 = new ChannelTypeUID(BINDING_ID, "rollershutter32");
ChannelTypeUID CHANNEL_TYPE_COLOR16 = new ChannelTypeUID(BINDING_ID, "color16");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
*/
package org.connectorio.addons.binding.fatek.config.channel;

import org.connectorio.addons.binding.config.PollingConfiguration;
import org.simplify4u.jfatek.registers.RegName;

public abstract class BaseChannelConfig implements RegisterConfig {
public abstract class BaseChannelConfig extends PollingConfiguration implements RegisterConfig {

public int index;

Expand Down

0 comments on commit 47e4e09

Please sign in to comment.