Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew committed Aug 4, 2014
1 parent 3ee2162 commit 1fcc222
Show file tree
Hide file tree
Showing 26 changed files with 4,031 additions and 0 deletions.
40 changes: 40 additions & 0 deletions PCR1000.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCR1000LibTest", "PCR1000LibTest\PCR1000LibTest.csproj", "{CFA2F945-2D45-4699-90BE-D42D9F738BE0}"
ProjectSection(ProjectDependencies) = postProject
{29487920-2926-48B7-BD8C-B2761696663B} = {29487920-2926-48B7-BD8C-B2761696663B}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCR1000", "PCR1000\PCR1000.csproj", "{29487920-2926-48B7-BD8C-B2761696663B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCRNetworkServer", "PCRNetworkServer\PCRNetworkServer.csproj", "{8020673D-A3BA-4EE2-BC61-2B5A02385EBA}"
ProjectSection(ProjectDependencies) = postProject
{29487920-2926-48B7-BD8C-B2761696663B} = {29487920-2926-48B7-BD8C-B2761696663B}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CFA2F945-2D45-4699-90BE-D42D9F738BE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFA2F945-2D45-4699-90BE-D42D9F738BE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFA2F945-2D45-4699-90BE-D42D9F738BE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CFA2F945-2D45-4699-90BE-D42D9F738BE0}.Release|Any CPU.Build.0 = Release|Any CPU
{29487920-2926-48B7-BD8C-B2761696663B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29487920-2926-48B7-BD8C-B2761696663B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29487920-2926-48B7-BD8C-B2761696663B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29487920-2926-48B7-BD8C-B2761696663B}.Release|Any CPU.Build.0 = Release|Any CPU
{8020673D-A3BA-4EE2-BC61-2B5A02385EBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8020673D-A3BA-4EE2-BC61-2B5A02385EBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8020673D-A3BA-4EE2-BC61-2B5A02385EBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8020673D-A3BA-4EE2-BC61-2B5A02385EBA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions PCR1000.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=PCR1000_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
100 changes: 100 additions & 0 deletions PCR1000/IComm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* IComm
* Interface for serial communication component of the PCR1000 Library
*
* Copyright Matthew Knox © 2013-Present.
* This program is distributed with no warentee or garentee
* what so ever. Do what you want with it as long as attribution
* to the origional authour and this comment is provided at the
* top of this source file and any derivative works. Also any
* modifications must be in real Australian, New Zealand or
* British English where the language allows.
*/

// ReSharper disable EventNeverSubscribedTo.Global
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMethodReturnValue.Global

using System;

namespace PCR1000
{
/// <summary>
/// In AutoUpdate mode data was received.
/// </summary>
/// <param name="sender">The IComm object that received the communication.</param>
/// <param name="recvTime">The time which the communication was received.</param>
/// <param name="data">The data received.</param>
public delegate void AutoUpdateDataRecv(IComm sender, DateTime recvTime, string data);

/// <summary>
/// Communications interface. All PCR1000 communications should happen through
/// classes derived from this interface.
/// </summary>
public interface IComm : IDisposable
{
/// <summary>
/// Data received in autoupdate mode.
/// </summary>
event AutoUpdateDataRecv AutoUpdateDataReceived;

/// <summary>
/// Gets and sets autoupdate mode.
/// </summary>
bool AutoUpdate { get; set; }

/// <summary>
/// Gets the object refering to the raw communications port.
/// </summary>
/// <returns>The communications port object.</returns>
object GetRawPort();

#if DEBUG
/// <summary>
/// Enables or disables debug logging in the comminication library.
/// </summary>
/// <param name="debug">Enable or disable.</param>
void SetDebugLogger(bool debug);
#endif

/// <summary>
/// Sends a messsage to the PCR1000.
/// </summary>
/// <param name="cmd">The command to send.</param>
/// <returns>If sending succeeded.</returns>
bool Send(string cmd);

/// <summary>
/// Sends a message to the PCR1000 and waits for a reply.
/// </summary>
/// <param name="cmd">The command to send.</param>
/// <param name="overrideAutoupdate">When in autoupdate mode behaves like Send()
/// this overrides that behaviour.</param>
/// <returns>The reply or "" if nothing is received.</returns>
string SendWait(string cmd, bool overrideAutoupdate = false);

/// <summary>
/// Gets the latest message from the PCR1000.
/// </summary>
/// <returns>The latest message.</returns>
string GetLastReceived();

/// <summary>
/// Gets the previously received message.
/// </summary>
/// <returns>The previous message.</returns>
string GetPrevReceived();

/// <summary>
/// Opens the PCR1000 serial port.
/// </summary>
/// <returns>Success</returns>
bool PcrOpen();

/// <summary>
/// Closes the PCR1000 serial port.
/// </summary>
/// <returns>Success</returns>
bool PcrClose();
}
}
58 changes: 58 additions & 0 deletions PCR1000/PCR1000.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?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>{29487920-2926-48B7-BD8C-B2761696663B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PCR1000</RootNamespace>
<AssemblyName>PCR1000</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\PCR1000.xml</DocumentationFile>
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="IComm.cs" />
<Compile Include="PcrComm.cs" />
<Compile Include="PcrControl.cs" />
<Compile Include="PcrDef.cs" />
<Compile Include="PcrNetwork.cs" />
<Compile Include="Properties\Annotations.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="PcrControl.cd" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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>
Loading

0 comments on commit 1fcc222

Please sign in to comment.