Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit f0de0f31 authored by Terry Burns's avatar Terry Burns Committed by Kostis ANAGNOSTOPOULOS
Browse files
parent 9eb43593
No related branches found
No related tags found
No related merge requests found
Imports System.IO
''' <summary>
''' Alternator Efficiency Map
''' </summary>
''' <remarks></remarks>
Public Class AlternatorMapInterpolated
''' <summary>
''' path to csv file containing map data
''' expects header row
''' Columns - [rpm - integer], [efficiency float, range 0-1], [max regen power float]
''' </summary>
''' <remarks></remarks>
Private ReadOnly filePath As String
Public map As Dictionary(Of AlternatorMapKey, AlternatorMapValues)
''' <summary>
''' Creates a new instance of AlternatorMap class
''' </summary>
''' <param name="filePath">full path to csv data</param>
''' <remarks></remarks>
Public Sub New(ByVal filePath As String)
Me.filePath = filePath
End Sub
''' <summary>
''' Initialise the map from supplied csv data
''' </summary>
''' <returns>Boolean - true if map is created successfully</returns>
''' <remarks></remarks>
Public Function Initialise() As Boolean
If File.Exists(filePath) Then
Using sr As StreamReader = New StreamReader(filePath)
'get array og lines fron csv
Dim lines() As String = sr.ReadToEnd().Split(CType(Environment.NewLine, Char()), StringSplitOptions.RemoveEmptyEntries)
'Must have at least 2 entries in map to make it usable [dont forget the header row]
If (lines.Count() < 3) Then
Throw New ArgumentException("Insufficient rows in csv to build a usable map")
End If
map = New Dictionary(Of AlternatorMapKey, AlternatorMapValues)()
Dim firstline As Boolean = True
For Each line As String In lines
If Not firstline Then
'split the line
Dim elements() As String = line.Split(New Char() {","}, StringSplitOptions.RemoveEmptyEntries)
'3 entries per line required
If (elements.Length <> 3) Then
Throw New ArgumentException("Incorrect number of values in csv file")
End If
'add values to map
'Create AlternatorKey
Dim aKey As AlternatorMapKey = New AlternatorMapKey(elements(0), elements(1))
Dim aValue As AlternatorMapValues = New AlternatorMapValues()
'Add Efficiency Value to Key.
map.Add(aKey, New AlternatorMapValues(elements(2)))
Else
firstline = False
End If
Next line
End Using
Return True
Else
Throw New ArgumentException("Supplied input file does not exist")
End If
End Function
''' <summary>
''' Returns the alternator efficiency at given rpm
''' </summary>
''' <param name="rpm">alternator rotation speed</param>
''' <returns>Single</returns>
''' <remarks></remarks>
Public Function GetEfficiency(ByVal rpm As Integer) As Single
'Dim tupleValue As AlternatorMapValues = GetValueOrInterpolate(rpm)
'Dim value As Single = tupleValue.Efficiency
'Return value
Return 0 'TODO:FIX THIS
End Function
''' <summary>
''' Returns the alternator Maximum Regeneration Power at given rpm
''' </summary>
''' <param name="rpm">alternator rotation speed</param>
''' <returns>Single</returns>
''' <remarks></remarks>
Public Function GetMaximumRegenerationPower(ByVal rpm As Integer) As Single
'Dim value As AlternatorMapValues = GetValueOrInterpolate(rpm)
'Return value.Amps
Return 0 'TODO:FIX THIS
End Function
''' <summary>
''' Returns a AlternatorMapValues instance containing the entries at a given key, or new interpolated values
''' </summary>
''' <returns>AlternatorMapValues</returns>
''' <remarks>Throws exception if rpm are outside map</remarks>
Public Function GetValueOrInterpolate(mapKey As AlternatorMapKey) As AlternatorMapValues
'check the rpm is within the map
'Dim min As AlternatorMapKey = map.Keys.Min()
'Dim max As AlternatorMapKey = map.Keys.Max()
'If mapKey.amps < 0 OrElse mapKey.amps > max.amps OrElse mapKey.rpm < 0 OrElse mapKey.rpm > max.rpm Then
' Throw New ArgumentOutOfRangeException(String.Format("Extrapolation - Amp/Rpm Values should should be in the range {0} to {1}", min.ToString(), max.ToString()))
'End If
'Check if the rpm is in the current memo
'If supplied present key, we can just return the values
If map.ContainsKey(mapKey) Then
Return map(mapKey)
End If
'Get Pre and Post Keys.
Dim rpmEfficiency As Single
Dim ampsEfficiency As Single
Dim rpmPre As AlternatorMapValues
Dim rpmPost As AlternatorMapValues
Dim ampsPre As AlternatorMapValues
Dim ampsPost As AlternatorMapValues
Dim intRpmPre As Integer
Dim intRpmPost As Integer
Dim intAmpsPre As Integer
Dim intAmpsPost As Integer
intRpmPre = (From m In map Where m.Key.rpm < mapKey.rpm Select m.Key.rpm).Last()
intRpmPost = (From m In map Where m.Key.rpm > mapKey.rpm Select m.Key.rpm).First()
intAmpsPre = (From m In map Where m.Key.amps < mapKey.amps Select m.Key.amps).Last()
intAmpsPost = (From m In map Where m.Key.amps > mapKey.amps Select m.Key.amps).First()
rpmPre = map(New AlternatorMapKey(intAmpsPre, intRpmPre))
rpmPost = map(New AlternatorMapKey(intAmpsPre, intRpmPost))
ampsPre = map(New AlternatorMapKey(intAmpsPost, intRpmPre))
ampsPost = map(New AlternatorMapKey(intAmpsPost, intRpmPost))
'********** A-B Efficiency ( Lower Amps ) ************
'get the delta values for rpm and the values
Dim dRpm As Integer = intRpmPost - intRpmPre
Dim dRpmEfficiency As Single = rpmPost.Efficiency - rpmPre.Efficiency
'calculate the slopes
Dim rpmEfficiencySlope As Single = dRpmEfficiency / dRpm
'calculate the new values
Dim AB_Efficiency As Single = ((mapKey.rpm - intRpmPre) * rpmEfficiencySlope) + rpmPre.Efficiency
'********** C-D Efficiency ( Higher Amps ) ************
'get the delta values for rpm and the values
dRpm = intRpmPost - intRpmPre
dRpmEfficiency = ampsPost.Efficiency - ampsPre.Efficiency
'calculate the slopes
rpmEfficiencySlope = dRpmEfficiency / dRpm
'calculate the new values
Dim CD_Efficiency As Single = ((mapKey.rpm - intRpmPre) * rpmEfficiencySlope) + ampsPre.Efficiency
'(C-D) - (A-B) Efficiency
'Deltas
Dim dAmps = intAmpsPost - intAmpsPre
Dim dAmpEfficiency = CD_Efficiency - AB_Efficiency
'slopes
Dim ampsEfficiencySlope As Single = dAmpEfficiency / dAmps
'calculate final Values
Dim ABCDEfficiency = ((mapKey.amps - intAmpsPre) * ampsEfficiencySlope) + AB_Efficiency
Return New AlternatorMapValues(ABCDEfficiency)
End Function
''' <summary>
''' Encapsulates Efficiency and Maximum Regeneration Power values for Alternator
''' </summary>
Public Structure AlternatorMapValues
Public ReadOnly Efficiency As Single
Public Sub New(ByVal efficiency As Single)
Me.Efficiency = efficiency
End Sub
End Structure
Public Structure AlternatorMapKey
Public amps As Integer
Public rpm As Integer
Public Sub New(ByVal amps As Integer, ByVal rpm As Integer)
Me.amps = amps
Me.rpm = rpm
End Sub
Public Overrides Function ToString() As String
Return "Amps:" & amps & " / " & "Rpm:" & rpm
End Function
End Structure
End Class
Imports System.IO
''' <summary>
''' Alternator Efficiency Map
''' </summary>
''' <remarks></remarks>
Public Class AlternatorMapInterpolated
''' <summary>
''' path to csv file containing map data
''' expects header row
''' Columns - [rpm - integer], [efficiency float, range 0-1], [max regen power float]
''' </summary>
''' <remarks></remarks>
Private ReadOnly filePath As String
Public map As List(Of AlternatorMapValues)
''' <summary>
''' Creates a new instance of AlternatorMap class
''' </summary>
''' <param name="filePath">full path to csv data</param>
''' <remarks></remarks>
Public Sub New(ByVal filePath As String)
Me.filePath = filePath
End Sub
''' <summary>
''' Initialise the map from supplied csv data
''' </summary>
''' <returns>Boolean - true if map is created successfully</returns>
''' <remarks></remarks>
Public Function Initialise() As Boolean
If File.Exists(filePath) Then
Using sr As StreamReader = New StreamReader(filePath)
'get array og lines fron csv
Dim lines() As String = sr.ReadToEnd().Split(CType(Environment.NewLine, Char()), StringSplitOptions.RemoveEmptyEntries)
'Must have at least 2 entries in map to make it usable [dont forget the header row]
If (lines.Count() < 3) Then
Throw New ArgumentException("Insufficient rows in csv to build a usable map")
End If
map = New List(Of AlternatorMapValues)()
Dim firstline As Boolean = True
For Each line As String In lines
If Not firstline Then
'split the line
Dim elements() As String = line.Split(New Char() {","}, StringSplitOptions.RemoveEmptyEntries)
'3 entries per line required
If (elements.Length <> 3) Then
Throw New ArgumentException("Incorrect number of values in csv file")
End If
'add values to map
map.Add(New AlternatorMapValues(elements(0), elements(2), elements(1)))
Else
firstline = False
End If
Next line
End Using
Return True
Else
Throw New ArgumentException("Supplied input file does not exist")
End If
End Function
''' <summary>
''' Returns the alternator efficiency at given rpm
''' </summary>
''' <param name="rpm">alternator rotation speed</param>
''' <returns>Single</returns>
''' <remarks></remarks>
Public Function GetEfficiency(ByVal rpm As Integer) As Single
Dim tupleValue As AlternatorMapValues = GetValueOrInterpolate(rpm)
Dim value As Single = tupleValue.Efficiency
Return value
End Function
''' <summary>
''' Returns the alternator Maximum Regeneration Power at given rpm
''' </summary>
''' <param name="rpm">alternator rotation speed</param>
''' <returns>Single</returns>
''' <remarks></remarks>
Public Function GetMaximumRegenerationPower(ByVal rpm As Integer) As Single
Dim value As AlternatorMapValues = GetValueOrInterpolate(rpm)
Return value.Amps
End Function
''' <summary>
''' Returns a AlternatorMapValues instance containing the entries at a given key, or new interpolated values
''' </summary>
''' <returns>AlternatorMapValues</returns>
''' <remarks>Throws exception if rpm are outside map</remarks>
Private Function GetValueOrInterpolate(ByVal rpm As Integer) As AlternatorMapValues
'check the rpm is within the map
Dim min As Integer = map.Keys.Min()
Dim max As Integer = map.Keys.Max()
If rpm < min OrElse rpm > max Then
Throw New ArgumentOutOfRangeException(String.Format("Extrapolation - rpm should be in the range {0} to {1}", min, max), rpm)
End If
'Check if the rpm is in the current memo
'If supplied rpm is a key, we can just return the values
If map.ContainsKey(rpm) Then
Return map(rpm)
End If
'Not a key value, interpolate
'get the entries before and after the supplied rpm
Dim pre As KeyValuePair(Of Integer, AlternatorMapValues) = (From m In map Where m.Key < rpm Select m).Last()
Dim post As KeyValuePair(Of Integer, AlternatorMapValues) = (From m In map Where m.Key > rpm Select m).First()
'get the delta values for rpm and the values
Dim dRpm As Integer = post.Key - pre.Key
Dim dEfficiency As Single = post.Value.Efficiency - pre.Value.Efficiency
Dim dPower As Single = post.Value.Amps - pre.Value.Amps
'calculate the slopes
Dim efficiencySlope As Single = dEfficiency / dRpm
Dim powerSlope As Single = dPower / dRpm
'calculate the new values
Dim efficiency As Single = ((rpm - pre.Key) * efficiencySlope) + pre.Value.Efficiency
Dim regenPower As Single = ((rpm - pre.Key) * powerSlope) + pre.Value.Amps
'Build a new AlternatorMapValues instance
Return New AlternatorMapValues(efficiency, regenPower, rpm)
End Function
''' <summary>
''' Encapsulates Efficiency and Maximum Regeneration Power values for Alternator
''' </summary>
Public Structure AlternatorMapValues
Public ReadOnly RPM As Integer
''' <summary>
''' Efficiency of alternator at a given rotation speed
''' </summary>
Public ReadOnly Efficiency As Single
''' <summary>
''' Maximum regeneration rower of alternator at a given rotation speed
''' </summary>
Public ReadOnly Amps As Single
''' <summary>
''' Creates a new instance of AlternatorMapValues
''' </summary>
''' <param name="efficiency">Efficiency Value</param>
''' <param name="maxRegenPower">Maximum Regeneration Power value</param>
Public Sub New(ByVal rpm As Integer, ByVal amps As Single, efficiency As Single)
Me.Efficiency = efficiency
Me.Amps = amps
Me.RPM = rpm
End Sub
End Structure
End Class
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{29E00F22-74A9-47F4-8A09-C68B42AF45AA}</ProjectGuid>
<OutputType>Exe</OutputType>
<StartupObject>MapTests.Module1</StartupObject>
<RootNamespace>MapTests</RootNamespace>
<AssemblyName>MapTests</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Console</MyType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>MapTests.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>MapTests.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="AlternatorMapInterpolated.vb" />
<Compile Include="Module1.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="bin\Debug\nonInterpolated.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="bin\Debug\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file

Imports System.IO
Imports System.Text
Module Module1
Sub Main()
'CreateBigFile()
'Dim NonInterpolated As New AlternatorMapNonInterpolated("nonInterpolated.csv")
'Dim nonIntReadStart = New TimeSpan(DateTime.Now.Ticks)
'NonInterpolated.Initialise()
'Dim nonIntReadStop = New TimeSpan(DateTime.Now.Ticks)
'Console.WriteLine("NONE INTERP 56*200")
'Console.WriteLine("___________________")
'Console.WriteLine("Started Initialise {0}", nonIntReadStart.ToString("fff"))
'Console.WriteLine("Stopped Initialise {0}", nonIntReadStop.ToString("fff"))
'Console.WriteLine("Delta ( ms ) {0}", (nonIntReadStop - nonIntReadStart).ToString("fff"))
Dim map As AlternatorMapInterpolated = New AlternatorMapInterpolated("interpolated.csv")
Dim efficiency As AlternatorMapInterpolated.AlternatorMapValues
map.Initialise()
Dim nonIntReadStart = New TimeSpan(DateTime.Now.Ticks)
For rpm As Integer = 2100 To 3099 Step 1
efficiency = map.GetValueOrInterpolate(New AlternatorMapInterpolated.AlternatorMapKey(15, rpm))
Next
Dim nonIntReadStop = New TimeSpan(DateTime.Now.Ticks)
Console.WriteLine("Interpolated Values - 1000 Interpolations between 2100 and 3099")
Console.WriteLine("___________________")
Console.WriteLine("Started {0}", nonIntReadStart.ToString("fff"))
Console.WriteLine("Stopped {0}", nonIntReadStop.ToString("fff"))
Console.WriteLine("Delta ( ms ) {0}", (nonIntReadStop - nonIntReadStart).ToString("fff"))
Console.ReadLine()
End Sub
'Function getNearestValues(ByVal rpm As Integer, ByVal amps As Integer, ByRef map As AlternatorMapNonInterpolated) As Single
' Dim efficiency As Single
' If (rpm Mod 100 = 0 AndAlso Math.Floor(amps) = amps) Then
' efficiency = (From values In map.map Where values.RPM = rpm And values.Efficiency = amps).First.Amps
' Return efficiency / 100
' End If
' Dim positionRpm As Integer = rpm Mod 100
' If positionRpm <= 50 Then
' positionRpm = rpm - positionRpm
' Else
' positionRpm = rpm - positionRpm + 100
' End If
' Dim positionAmps As Single
' If amps - Math.Floor(amps) <= 0.5 Then
' positionAmps = Math.Floor(amps)
' Else
' positionAmps = Math.Ceiling(amps)
' End If
' efficiency = (From values In map.map Where values.RPM = positionRpm And values.Efficiency = positionAmps).First.Amps
' Return efficiency / 100
'End Function
End Module
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.18444
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
<?xml version="1.0" encoding="utf-8"?>
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>false</MySubMain>
<SingleInstance>false</SingleInstance>
<ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode>
<ApplicationType>2</ApplicationType>
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
</MyApplicationData>
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("MapTests")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("AEA Group")>
<Assembly: AssemblyProduct("MapTests")>
<Assembly: AssemblyCopyright("Copyright © AEA Group 2014")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("4e59cec7-1742-4b12-bc7a-3bb161793f40")>
' Version information for an assembly consists of the following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.18444
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("MapTests.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.18444
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Namespace My
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.MapTests.My.MySettings
Get
Return Global.MapTests.My.MySettings.Default
End Get
End Property
End Module
End Namespace
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment