Skip to content

Commit

Permalink
Version 8.5.1801.2201
Browse files Browse the repository at this point in the history
  • Loading branch information
gurux01 committed Jan 22, 2018
1 parent 8e1bc99 commit bcff0c5
Show file tree
Hide file tree
Showing 15 changed files with 943 additions and 132 deletions.
13 changes: 11 additions & 2 deletions Development/GXDLMSDirector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@
<Reference Include="Gurux.DLMS, Version=8.5.1801.1202, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Gurux.DLMS.8.5.1801.1202\lib\portable-win+net35\Gurux.DLMS.dll</HintPath>
</Reference>
<Reference Include="Gurux.DLMS.UI, Version=8.5.1801.1201, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Gurux.DLMS.UI.8.5.1801.1201\lib\portable-win+net40\Gurux.DLMS.UI.dll</HintPath>
<Reference Include="Gurux.DLMS.UI, Version=8.5.1801.2201, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Gurux.DLMS.UI.8.5.1801.2201\lib\portable-win+net40\Gurux.DLMS.UI.dll</HintPath>
</Reference>
<Reference Include="Gurux.Net, Version=8.1.1801.1201, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Gurux.Net.8.1.1801.1201\lib\portable-win+net40\Gurux.Net.dll</HintPath>
Expand Down Expand Up @@ -168,6 +168,12 @@
<Compile Include="GXExternalMediaForm.Designer.cs">
<DependentUpon>GXExternalMediaForm.cs</DependentUpon>
</Compile>
<Compile Include="GXFindDlg.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GXFindDlg.Designer.cs">
<DependentUpon>GXFindDlg.cs</DependentUpon>
</Compile>
<Compile Include="GXSettingsDlg.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -232,6 +238,9 @@
<EmbeddedResource Include="GXExternalMediaForm.resx">
<DependentUpon>GXExternalMediaForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GXFindDlg.resx">
<DependentUpon>GXFindDlg.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GXObisValueItemForm.resx">
<DependentUpon>GXObisValueItemForm.cs</DependentUpon>
<SubType>Designer</SubType>
Expand Down
6 changes: 0 additions & 6 deletions Development/GXExternalMediaForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,9 @@
//---------------------------------------------------------------------------
using Gurux.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using System.Windows.Forms;

namespace GXDLMSDirector
Expand Down
108 changes: 108 additions & 0 deletions Development/GXFindDlg.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

169 changes: 169 additions & 0 deletions Development/GXFindDlg.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
//
// --------------------------------------------------------------------------
// Gurux Ltd
//
//
//
//
// Version: $Revision: 9442 $,
// $Date: 2017-05-23 15:21:03 +0300 (ti, 23 touko 2017) $
// $Author: gurux01 $
//
// Copyright (c) Gurux Ltd
//
//---------------------------------------------------------------------------
//
// DESCRIPTION
//
// This file is a part of Gurux Device Framework.
//
// Gurux Device Framework is Open Source software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 of the License.
// Gurux Device Framework is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// More information of Gurux DLMS/COSEM Director: http:https://www.gurux.org/GXDLMSDirector
//
// This code is licensed under the GNU General Public License v2.
// Full text may be retrieved at http:https://www.gnu.org/licenses/gpl-2.0.txt
//---------------------------------------------------------------------------

using Gurux.Common;
using System;
using System.Reflection;
using System.Windows.Forms;

namespace GXDLMSDirector
{
/// <summary>
/// Search dialog for OBIS code.
/// </summary>
partial class GXFindDlg : Form
{
public string Target
{
get;
set;
}

/// <summary>
/// Constructor.
/// </summary>
/// <param name="target">OBIS code to search.</param>
public GXFindDlg(string target)
{
InitializeComponent();
FindTb.Text = target;
}

#region Assembly Attribute Accessors

public string AssemblyTitle
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
if (attributes.Length > 0)
{
AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0];
if (titleAttribute.Title != "")
{
return titleAttribute.Title;
}
}
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
}
}

public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}

public string AssemblyDescription
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
}
}

public string AssemblyProduct
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyProductAttribute)attributes[0]).Product;
}
}

public string AssemblyCopyright
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
}
}

public string AssemblyCompany
{
get
{
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
if (attributes.Length == 0)
{
return "";
}
return ((AssemblyCompanyAttribute)attributes[0]).Company;
}
}
#endregion

private void FindBtn_Click(object sender, EventArgs e)
{
try
{
//If OBIS code is given as hex.
if (FindTb.Text.IndexOf('.') == -1)
{
byte[] tmp = GXCommon.HexToBytes(FindTb.Text);
if (tmp.Length != 6)
{
throw new Exception("Invalid OBIS code.");
}
Target = tmp[5].ToString() + '.' + tmp[4] + '.' + tmp[3] + '.' + tmp[2] + '.' + tmp[1] + '.' + tmp[0] + '.';
}
else if (FindTb.Text.Split(new char[] { '.' }).Length != 6)
{
throw new Exception("Invalid OBIS code.");
}
Target = FindTb.Text.Trim();
}
catch (Exception Ex)
{
GXDLMS.Common.Error.ShowError(this, Ex);
DialogResult = DialogResult.None;
}
}
}
}
Loading

0 comments on commit bcff0c5

Please sign in to comment.