arMaskterK 프로젝트를 vms2016_cs 레포에서 현 레포로 이동
This commit is contained in:
61
Sub/arMasterK/Demo/Demo.csproj
Normal file
61
Sub/arMasterK/Demo/Demo.csproj
Normal file
@@ -0,0 +1,61 @@
|
||||
<?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>{D92246F1-981A-452C-9E0A-09CD9F68B102}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Demo</RootNamespace>
|
||||
<AssemblyName>Demo</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<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" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Project\arMasterK.csproj">
|
||||
<Project>{e0133085-e5f9-4275-9db8-f8f20ef8561f}</Project>
|
||||
<Name>arMasterK</Name>
|
||||
</ProjectReference>
|
||||
</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>
|
||||
86
Sub/arMasterK/Demo/Program.cs
Normal file
86
Sub/arMasterK/Demo/Program.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Demo
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static arDev.MasterK dev;
|
||||
static void Main(string[] args)
|
||||
{
|
||||
dev = new arDev.MasterK();
|
||||
dev.Message += dev_Message;
|
||||
if (!dev.Init("COM8", 9600))
|
||||
{
|
||||
Console.WriteLine("init error");
|
||||
Console.ReadKey();
|
||||
return;
|
||||
}
|
||||
|
||||
System.Text.StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("=====================");
|
||||
sb.AppendLine("Master K Protocol Test");
|
||||
sb.AppendLine("Version : 0.1");
|
||||
sb.AppendLine("Author : tindevil@nate.com");
|
||||
sb.AppendLine("=====================");
|
||||
sb.AppendLine("1. Port 40 - ON");
|
||||
sb.AppendLine("2. Port 40 - OFF");
|
||||
sb.AppendLine("3. Port 41 - ON");
|
||||
sb.AppendLine("4. Port 41 - OFF");
|
||||
sb.AppendLine("5. Read Port");
|
||||
sb.AppendLine("9. Exit");
|
||||
sb.AppendLine("=====================");
|
||||
sb.Append("Select Menu = ");
|
||||
|
||||
while (true)
|
||||
{
|
||||
Console.Write(sb.ToString());
|
||||
var key = Console.ReadKey(true);
|
||||
|
||||
//program end
|
||||
if (key.Key == ConsoleKey.D9) break;
|
||||
|
||||
switch (key.Key)
|
||||
{
|
||||
case ConsoleKey.D1:
|
||||
dev.SetOutput(0, true);
|
||||
break;
|
||||
case ConsoleKey.D2:
|
||||
dev.SetOutput(0, false);
|
||||
break;
|
||||
case ConsoleKey.D3:
|
||||
dev.SetOutput(1, true);
|
||||
break;
|
||||
case ConsoleKey.D4:
|
||||
dev.SetOutput(1, false);
|
||||
break;
|
||||
case ConsoleKey.D5:
|
||||
dev.Read_RelayPort();
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("========================");
|
||||
Console.WriteLine("DI:" + dev.GetInputState());
|
||||
Console.WriteLine("DO:" + dev.GetOutputState());
|
||||
Console.WriteLine("========================");
|
||||
Console.WriteLine("Press any key");
|
||||
Console.ReadKey();
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("unknown menu number");
|
||||
break;
|
||||
}
|
||||
Console.Clear();
|
||||
}
|
||||
|
||||
Console.WriteLine("Press any key : Exit");
|
||||
Console.ReadKey(true);
|
||||
}
|
||||
|
||||
static void dev_Message(object sender, arDev.MasterK.MessageEventArgs e)
|
||||
{
|
||||
Console.WriteLine((e.IsError ? "[ERR]" : "") + e.Message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
36
Sub/arMasterK/Demo/Properties/AssemblyInfo.cs
Normal file
36
Sub/arMasterK/Demo/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리의 일반 정보는 다음 특성 집합을 통해 제어됩니다.
|
||||
// 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이 특성 값을 변경하십시오.
|
||||
[assembly: AssemblyTitle("Demo")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Demo")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하십시오.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("d649cb64-a01f-4f2b-99b2-a2797844f375")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 버전이 자동으로
|
||||
// 지정되도록 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Reference in New Issue
Block a user