Skip to content

Commit

Permalink
Fixes, fixes, fixes...
Browse files Browse the repository at this point in the history
  • Loading branch information
jogibear9988 committed Jan 30, 2013
1 parent ae0158e commit 1124480
Show file tree
Hide file tree
Showing 80 changed files with 1,748 additions and 625 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste
if (value == null)
return null;
else
return new PLCTag(value.ToString()){LibNoDaveDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool};
return new PLCTag(value.ToString()){TagDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool};

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@
<DataGridTemplateColumn Width="Auto"
Header="PLC-Value Type"
IsReadOnly="False"
SortMemberPath="PLCTag.LibNoDaveDataType">
SortMemberPath="PLCTag.TagDataType">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding PLCTag.LibNoDaveDataType}" />
<TextBlock Text="{Binding PLCTag.TagDataType}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
Expand All @@ -253,7 +253,7 @@
VerticalAlignment="Top"
ItemsSource="{Binding Source={StaticResource tagdatatype}}"
Padding="0"
SelectedItem="{Binding PLCTag.LibNoDaveDataType}">
SelectedItem="{Binding PLCTag.TagDataType}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Padding="3,0,0,0" Text="{Binding}" />
Expand Down Expand Up @@ -911,15 +911,15 @@
<DataGridTemplateColumn Width="Auto"
Header="PLC-Value Type"
IsReadOnly="False"
SortMemberPath="PLCTag.LibNoDaveDataType">
SortMemberPath="PLCTag.TagDataType">
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Margin="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
ItemsSource="{Binding Source={StaticResource tagdatatype}}"
Padding="0"
SelectedItem="{Binding PLCTag.LibNoDaveDataType}">
SelectedItem="{Binding PLCTag.TagDataType}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Padding="3,0,0,0" Text="{Binding}" />
Expand All @@ -930,14 +930,14 @@
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding PLCTag.LibNoDaveDataType}" />
<TextBlock Text="{Binding PLCTag.TagDataType}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="Auto"
Header="PLC-Read Byte Size"
IsReadOnly="True"
SortMemberPath="PLCTag.LibNoDaveDataType">
SortMemberPath="PLCTag.TagDataType">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding PLCTag.ReadByteSize}" />
Expand Down Expand Up @@ -1158,7 +1158,7 @@
<ComboBox Visibility="{Binding IsChecked, Converter={StaticResource boolToVisibilityConverter}, ElementName=cb_ExpertMode}" Height="23" HorizontalAlignment="Left" IsEnabled="{Binding ElementName=grdDatasets, Path=SelectedItem, Converter={StaticResource myNullToFalseConverter}}"
ItemsSource="{Binding Source={StaticResource tagdatatype}}"
Padding="0"
SelectedItem="{Binding PLCTag.LibNoDaveDataType}"
SelectedItem="{Binding PLCTag.TagDataType}"
Margin="671,221,0,0" Name="cmb_PLCType" VerticalAlignment="Top" VerticalContentAlignment="Center" Width="65">
<ComboBox.ItemTemplate>
<DataTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private void cmdSelectReadBitFromProject_Click(object sender, RoutedEventArgs e)
var tmp = DotNetSiemensPLCToolBoxLibrary.Projectfiles.SelectProjectPart.SelectTAG("");
if (tmp != null)
{
tmp.LibNoDaveDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
tmp.TagDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
conf.TriggerReadBit = tmp;
}
}
Expand All @@ -63,7 +63,7 @@ private void cmdEditReadBit_Click(object sender, RoutedEventArgs e)
var tmp = DotNetSiemensPLCToolBoxLibrary.Communication.PLCTagEditor.ShowPLCTagEditor(conf.TriggerReadBit);
if (tmp != null)
{
tmp.LibNoDaveDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
tmp.TagDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
conf.TriggerReadBit = tmp;
}
}
Expand Down Expand Up @@ -164,7 +164,7 @@ private void cmdEditQuittBit_Click(object sender, RoutedEventArgs e)
var tmp = DotNetSiemensPLCToolBoxLibrary.Communication.PLCTagEditor.ShowPLCTagEditor(conf.TriggerQuittBit);
if (tmp != null)
{
tmp.LibNoDaveDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
tmp.TagDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
conf.TriggerQuittBit = tmp;
}
}
Expand All @@ -178,7 +178,7 @@ private void cmdSelectQuitBitFromProject_Click(object sender, RoutedEventArgs e)
var tmp = DotNetSiemensPLCToolBoxLibrary.Projectfiles.SelectProjectPart.SelectTAG("");
if (tmp != null)
{
tmp.LibNoDaveDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
tmp.TagDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool;
conf.TriggerQuittBit = tmp;
}
}
Expand Down Expand Up @@ -406,7 +406,7 @@ private void button1_Click(object sender, RoutedEventArgs e)
{
foreach (DatasetConfigRow item in ProtokollerConfiguration.ActualConfigInstance.Datasets[grdDatasets.SelectedIndex].DatasetConfigRows)
{
if (item.PLCTag.LibNoDaveDataType.ToString() == cmb_PLCType.SelectedValue.ToString())
if (item.PLCTag.TagDataType.ToString() == cmb_PLCType.SelectedValue.ToString())
item.DatabaseFieldType = cmb_DBType.SelectedValue.ToString();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ protected override bool _internal_Write()
if (akValue is DateTime)
{

if (datasetConfig.DatasetConfigRows[spalte].PLCTag.LibNoDaveDataType ==
if (datasetConfig.DatasetConfigRows[spalte].PLCTag.TagDataType ==
DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Date)
akWorksheet.Cells[zeile, spalte] = new Cell(akValue, @"YYYY\-MM\-DD");
else if (datasetConfig.DatasetConfigRows[spalte].PLCTag.LibNoDaveDataType ==
else if (datasetConfig.DatasetConfigRows[spalte].PLCTag.TagDataType ==
DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.TimeOfDay)
akWorksheet.Cells[zeile, spalte] = new Cell(akValue, @"hh:mm:ss");
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ protected override bool _internal_Write()
if (akValue is DateTime)
{

if (datasetConfig.DatasetConfigRows[spalte].PLCTag.LibNoDaveDataType ==
if (datasetConfig.DatasetConfigRows[spalte].PLCTag.TagDataType ==
DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Date)
akWorksheet.Cells[zeile, spalte].Value = akValue;
else if (datasetConfig.DatasetConfigRows[spalte].PLCTag.LibNoDaveDataType ==
else if (datasetConfig.DatasetConfigRows[spalte].PLCTag.TagDataType ==
DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.TimeOfDay)
akWorksheet.Cells[zeile, spalte].Value = akValue;
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected override bool _internal_Write()
DatasetConfigRow field = e1.Current;
Object value = e2.Current; //values[fnr++];

switch (field.PLCTag.LibNoDaveDataType)
switch (field.PLCTag.TagDataType)
{
case DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Int:
case DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Dint:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ protected override bool _internal_Write()
DatasetConfigRow field = e1.Current;
Object value = e2.Current; //values[fnr++];

switch (field.PLCTag.LibNoDaveDataType)
switch (field.PLCTag.TagDataType)
{
case DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Int:
case DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Dint:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public string CheckConfiguration(bool TestConnections)
//Look if DatabaseFieldType was selected
if (datasetConfigRow.DatabaseFieldType == "") error += "Error: Dataset \"" + datasetConfig.Name + "\" Row \"" + datasetConfigRow.DatabaseField + "\" - DatabaseFieldType not Set!" + Environment.NewLine;
////Look if PLC-ValueType was selected
if (datasetConfigRow.PLCTag.LibNoDaveDataType == null)
if (datasetConfigRow.PLCTag.TagDataType == null)
error += "Error: Dataset \"" + datasetConfig.Name + "\" Row \"" + datasetConfigRow.DatabaseField + "\" - PLC-ValueType not Set!" + Environment.NewLine;

if (TestConnections && datasetConfig.Trigger != DatasetTriggerType.Triggered_By_Incoming_Data_On_A_TCPIP_Connection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public virtual List<string> DatabaseFieldTypes

public virtual string GetDefaultDatabaseFieldTypeForLibNoDaveTag(PLCTag tag)
{
switch (tag.LibNoDaveDataType.ToString().ToLower().Trim())
switch (tag.TagDataType.ToString().ToLower().Trim())
{
case "float":
return "float";
Expand Down
12 changes: 6 additions & 6 deletions ExampleWPFVisualization/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,32 @@
TrueValue="Green" />

<Communication:PLCTag x:Key="Tag1"
LibNoDaveDataType="Word"
TagDataType="Word"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBW6" />
<Communication:PLCTag x:Key="Tag2"
DataTypeStringFormat="Decimal"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBW4" />
<Communication:PLCTag x:Key="Tag3"
LibNoDaveDataType="Float"
TagDataType="Float"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBD0" />
<Communication:PLCTag x:Key="Tag22"
LibNoDaveDataType="Float"
TagDataType="Float"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="DB1.DBD36" />
<Communication:PLCTag x:Key="Tag4"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="M10.0" />
<Communication:PLCTag x:Key="Tag5"
LibNoDaveDataType="BCDDWord"
TagDataType="BCDDWord"
PropertyChanged="PLCTag_PropertyChanged"
S7FormatAddress="MW200" />
<Communication:PLCTag x:Key="Tag6"
ByteAddress="0"
DatablockNumber="1"
LibNoDaveDataType="DateTime"
DataBlockNumber="1"
TagDataType="DateTime"
PropertyChanged="PLCTag_PropertyChanged" />
</ResourceDictionary>
</Window.Resources>
Expand Down
2 changes: 1 addition & 1 deletion ExampleWPFVisualization/StringToPLCValueBoolConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste
if (value == null)
return null;
else
return new PLCTag(value.ToString()){LibNoDaveDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool};
return new PLCTag(value.ToString()){TagDataType = DotNetSiemensPLCToolBoxLibrary.DataTypes.TagDataType.Bool};

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void tcp_DataRecieved(byte[] data, System.Net.Sockets.TcpClient client)

public void ReadValue(PLCTag tag)
{
var telHead = new byte[] { (byte)'S', (byte)'5', 16, 1, 3, 5, 3, 8, PLCConnectionID, (byte)tag.DatablockNumber, 0, 0, 0, 0, 0xff, 2 };
var telHead = new byte[] { (byte)'S', (byte)'5', 16, 1, 3, 5, 3, 8, PLCConnectionID, (byte)tag.DataBlockNumber, 0, 0, 0, 0, 0xff, 2 };
LibNoDave.libnodave.putBCD16at(telHead, 10, tag.ByteAddress);
LibNoDave.libnodave.putBCD16at(telHead, 10, tag.ReadByteSize);

Expand All @@ -44,7 +44,7 @@ public void ReadValue(PLCTag tag)
public void WriteValue(PLCTag tag)
{

var telHead = new byte[] { (byte)'S', (byte)'5', 16, 1, 3, 3, 3, 8, PLCConnectionID, (byte)tag.DatablockNumber, 0, 0, 0, 0, 0xff, 2 };
var telHead = new byte[] { (byte)'S', (byte)'5', 16, 1, 3, 3, 3, 8, PLCConnectionID, (byte)tag.DataBlockNumber, 0, 0, 0, 0, 0xff, 2 };
LibNoDave.libnodave.putBCD16at(telHead, 10, tag.ByteAddress);
LibNoDave.libnodave.putBCD16at(telHead, 10, tag.ReadByteSize);

Expand Down
Loading

0 comments on commit 1124480

Please sign in to comment.