Skip to content

Commit

Permalink
ModbusPlugin fixes;
Browse files Browse the repository at this point in the history
  • Loading branch information
noant committed Mar 22, 2019
1 parent 5dadbbe commit 7e2fdcd
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ModbusRegistersAction : IAction, IModbusRegistersAction

public byte SlaveAddress { get; set; } = 1;

public byte RegisterAddress { get; set; } = 0;
public ushort RegisterAddress { get; set; } = 0;

public ushort WriteReadLength { get; set; } = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ModbusSingleCoilAction : IAction, IModbusSingleCoilAction

public byte SlaveAddress { get; set; } = 1;

public byte CoilAddress { get; set; } = 0;
public ushort CoilAddress { get; set; } = 0;

public string Caption
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ public partial class RegistersActionView : UserControl
public RegistersActionView()
{
InitializeComponent();

tbAddress.Validation = EntryViewValidation.UShortValidation(max: 247);
tbCoil.Validation = EntryViewValidation.UShortValidation();

btOk.Click += (o, e) => {
_action.Manager.Transport = transportView.Transport;
_action.RegisterAddress = byte.Parse(tbCoil.Text);
_action.RegisterAddress = ushort.Parse(tbCoil.Text);
_action.SlaveAddress = byte.Parse(tbAddress.Text);
_action.ModbusValueType = valueTypeView.ValueType;
_action.WriteReadLength = valueTypeView.Length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public SingleCoilActionView()

btOk.Click += (o, e) => {
_action.Manager.Transport = transportView.Transport;
_action.CoilAddress = byte.Parse(tbCoil.Text);
_action.CoilAddress = ushort.Parse(tbCoil.Text);
_action.SlaveAddress = byte.Parse(tbAddress.Text);
OkPressed?.Invoke(_action);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public interface IModbusRegistersAction

byte SlaveAddress { get; set; }

byte RegisterAddress { get; set; }
ushort RegisterAddress { get; set; }

ushort WriteReadLength { get; set; }

Expand All @@ -16,4 +16,4 @@ public interface IModbusRegistersAction

Lazurite.ActionsDomain.ValueTypes.ValueTypeBase ValueType { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ public interface IModbusSingleCoilAction

byte SlaveAddress { get; set; }

byte CoilAddress { get; set; }
ushort CoilAddress { get; set; }
}
}
10 changes: 1 addition & 9 deletions LazuritePlugins/ModbusPlugin/TestProject/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,8 @@ public MainWindow()

public void Test()
{
//ModbusPluginUI.ConfigureTransportView.Show((t) => {
// var transport = t;
// t = null;
// Test();
//});

var action = new ModbusRegistersAction();
var action = new ModbusSingleCoilAction();
var result = action.UserInitializeWith(null, false);

var a = 0;
}
}
}
Binary file modified Releases/Plugins/ModbusPlugin.pyp
Binary file not shown.

0 comments on commit 7e2fdcd

Please sign in to comment.