Skip to content

Commit 6da1626

Browse files
committed
v2.43
- Fix bug import csv template with hex values - Added feature to avoid sending commands selecting cells in the live edit
1 parent 1dcce56 commit 6da1626

File tree

8 files changed

+351
-310
lines changed

8 files changed

+351
-310
lines changed

ModBus_Client/Config/SettingsToSave.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"CheckBoxUseOnlyReadSingleRegistersForGroups": {},
6363
"CheckBoxPreviewimportWriteMultipleRegisters": {},
6464
"CheckBoxPreviewImportCloseWindowAfterWrite": {},
65-
"CheckBoxPreviewImportAbortOnError": {}
65+
"CheckBoxPreviewImportAbortOnError": {},
66+
"CheckBoxSendCellEditOnlyOnChange": {}
6667
},
6768
"menuItems": {
6869
"viewTabCoilsOffset": {},

ModBus_Client/Lang/EN.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@
124124
"CheckBoxUseOnlyReadSingleRegistersForGroups": "Use only \"ReadSingleRegister\" for group resources",
125125
"CheckBoxPreviewimportWriteMultipleRegisters": "Write multiple registers (FC15 / FC16)",
126126
"CheckBoxPreviewImportCloseWindowAfterWrite": "Close window after write",
127-
"CheckBoxPreviewImportAbortOnError": "Abort write on error"
127+
"CheckBoxPreviewImportAbortOnError": "Abort write on error",
128+
"CheckBoxSendCellEditOnlyOnChange": "Send cell edits only on change"
128129
},
129130
"buttons": {
130131
"buttonUpdateSerialList": "Update",

ModBus_Client/Lang/IT.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@
124124
"CheckBoxUseOnlyReadSingleRegistersForGroups": "Usa solo \"ReadSingleRegister\" per risorse di gruppo",
125125
"CheckBoxPreviewimportWriteMultipleRegisters": "Write multiple registers (FC15 / FC16)",
126126
"CheckBoxPreviewImportCloseWindowAfterWrite": "Chiudi finestra al termine",
127-
"CheckBoxPreviewImportAbortOnError": "Interrompi in caso di errore"
127+
"CheckBoxPreviewImportAbortOnError": "Interrompi in caso di errore",
128+
"CheckBoxSendCellEditOnlyOnChange": "Invia modifiche celle solo su variazione"
128129
},
129130
"buttons": {
130131
"buttonUpdateSerialList": "Aggiorna",

ModBus_Client/ModBus_Client.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,7 @@
12621262
<CheckBox x:Name="CheckBoxPreviewImportAbortOnError" Content="Abort write on error" HorizontalAlignment="Left" Margin="43,402,0,0" VerticalAlignment="Top"/>
12631263
<Label x:Name="labelSettings_7" Content="Nr. of registers multiple write:" HorizontalAlignment="Left" Margin="44,424,0,0" VerticalAlignment="Top"/>
12641264
<TextBox x:Name="textBoxReadTimeout_Copy" HorizontalAlignment="Left" Height="23" Margin="325,424,0,0" TextWrapping="Wrap" Text="123" VerticalAlignment="Top" Width="69" TextChanged="TextBoxReadTimeout_TextChanged"/>
1265+
<CheckBox x:Name="CheckBoxSendCellEditOnlyOnChange" Content="Invia modifiche celle solo su variazione" HorizontalAlignment="Left" Margin="44,271,0,0" VerticalAlignment="Top" Checked="CheckBoxSendCellEditOnlyOnChange_Checked" Unchecked="CheckBoxSendCellEditOnlyOnChange_Checked"/>
12651266
</Grid>
12661267
</TabItem>
12671268
</TabControl>

ModBus_Client/ModBus_Client.xaml.cs

Lines changed: 324 additions & 286 deletions
Large diffs are not rendered by default.

ModBus_Client/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
// You can specify all the values or you can default the Build and Revision Numbers
5252
// by using the '*' as shown below:
5353
// [assembly: AssemblyVersion("1.0.*")]
54-
[assembly: AssemblyVersion("2.42.*")]
54+
[assembly: AssemblyVersion("2.43.*")]
5555
[assembly: AssemblyFileVersion("1.0.0.0")]

ModBus_Client/TemplateEditor.xaml.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ public void ExportCsvCoils()
475475

476476
this.Dispatcher.Invoke((Action)delegate
477477
{
478-
offset = comboBoxCoilsOffset.SelectedIndex == 1 ? "0x" : "" + textBoxCoilsOffset.Text;
478+
offset = (comboBoxCoilsOffset.SelectedIndex == 1 ? "0x" : "") + textBoxCoilsOffset.Text;
479479
registerHex = comboBoxCoilsRegistri.SelectedIndex == 1;
480480
});
481481

@@ -512,7 +512,7 @@ public void ExportCsvInputs()
512512

513513
this.Dispatcher.Invoke((Action)delegate
514514
{
515-
offset = comboBoxInputOffset.SelectedIndex == 1 ? "0x" : "" + textBoxInputOffset.Text;
515+
offset = (comboBoxInputOffset.SelectedIndex == 1 ? "0x" : "") + textBoxInputOffset.Text;
516516
registerHex = comboBoxInputRegistri.SelectedIndex == 1;
517517
});
518518

@@ -549,7 +549,7 @@ public void ExportCsvInputRegisters()
549549

550550
this.Dispatcher.Invoke((Action)delegate
551551
{
552-
offset = comboBoxInputRegOffset.SelectedIndex == 1 ? "0x" : "" + textBoxInputRegOffset.Text;
552+
offset = (comboBoxInputRegOffset.SelectedIndex == 1 ? "0x" : "") + textBoxInputRegOffset.Text;
553553
registerHex = comboBoxInputRegRegistri.SelectedIndex == 1;
554554
});
555555

@@ -586,7 +586,7 @@ public void ExportCsvHoldingRegisters()
586586

587587
this.Dispatcher.Invoke((Action)delegate
588588
{
589-
offset = comboBoxHoldingOffset.SelectedIndex == 1 ? "0x" : "" + textBoxHoldingOffset.Text;
589+
offset = (comboBoxHoldingOffset.SelectedIndex == 1 ? "0x" : "") + textBoxHoldingOffset.Text;
590590
registerHex = comboBoxHoldingRegistri.SelectedIndex == 1;
591591
});
592592

@@ -631,16 +631,20 @@ public void exportCsv(ObservableCollection<ModBus_Item> collection, String appen
631631
content += offset + (registerHex ? ",0x" : ",") + item.Register + "," + item.Value + "," + item.Notes + "," + item.Mappings + "," + item.Group + "\n";
632632
counter++;
633633

634-
if (counter % (collection.Count / 100) == 0)
634+
try
635635
{
636-
if (counter % (collection.Count / 100) == 0)
636+
if (collection.Count > 100)
637637
{
638-
this.Dispatcher.Invoke((Action)delegate
638+
if (counter % (collection.Count / 100) == 0)
639639
{
640-
TaskbarItemInfo.ProgressValue = (double)(counter) / (double)(collection.Count);
641-
});
640+
this.Dispatcher.Invoke((Action)delegate
641+
{
642+
TaskbarItemInfo.ProgressValue = (double)(counter) / (double)(collection.Count);
643+
});
644+
}
642645
}
643646
}
647+
catch { }
644648
}
645649
}
646650

@@ -655,22 +659,17 @@ public void exportCsv(ObservableCollection<ModBus_Item> collection, String appen
655659
});
656660
}
657661

658-
public void exportCsvThread()
659-
{
660-
661-
}
662-
663662
public void importCsv(ObservableCollection<ModBus_Item> collection, ComboBox comboBox, TextBox textBox, ComboBox comboBoxReg)
664663
{
665-
collection.Clear();
666-
667664
OpenFileDialog window = new OpenFileDialog();
668665

669666
window.Filter = "csv Files | *.csv";
670667
window.DefaultExt = ".csv";
671668

672669
if ((bool)window.ShowDialog())
673670
{
671+
collection.Clear();
672+
674673
string content = File.ReadAllText(window.FileName);
675674
string[] splitted = content.Split('\n');
676675

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Client ModBus TCP/RTU per interrogare slave ModBus.
33

44
## Release
55

6-
### v2.42 New Version
7-
[ModBus_Client_v2.42 - Portable Zip](https://github.com/fedeturco/ModBus_Client/releases/download/2.42/ModBus_Client_v2.42.zip)
6+
### v2.43 New Version
7+
[ModBus_Client_v2.43 - Portable Zip](https://github.com/fedeturco/ModBus_Client/releases/download/2.43/ModBus_Client_v2.43.zip)
88

9-
### v2.40 Stable
10-
[ModBus_Client_v2.40 - Portable Zip](https://github.com/fedeturco/ModBus_Client/releases/download/2.40/ModBus_Client_v2.40.zip)
9+
### v2.42 Stable
10+
[ModBus_Client_v2.42 - Portable Zip](https://github.com/fedeturco/ModBus_Client/releases/download/2.42/ModBus_Client_v2.42.zip)
1111

1212
### Manual
1313
[Manual EN](https://github.com/fedeturco/ModBus_Client/blob/master/ModBus_Client/Manuals/ModBus_Client_EN.pdf)

0 commit comments

Comments
 (0)