diff --git a/libs/ASControllerSDK.dll b/libs/ASControllerSDK.dll new file mode 100644 index 0000000..18feb64 Binary files /dev/null and b/libs/ASControllerSDK.dll differ diff --git a/libs/System.Runtime.WindowsRuntime.dll b/libs/System.Runtime.WindowsRuntime.dll new file mode 100644 index 0000000..4312c3a Binary files /dev/null and b/libs/System.Runtime.WindowsRuntime.dll differ diff --git a/sample/.gitignore b/sample/.gitignore new file mode 100644 index 0000000..571552e --- /dev/null +++ b/sample/.gitignore @@ -0,0 +1,278 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Typescript v1 declaration files +typings/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config \ No newline at end of file diff --git a/sample/AromaShooterControllerSample/App.config b/sample/AromaShooterControllerSample/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/sample/AromaShooterControllerSample/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/sample/AromaShooterControllerSample/ControllerSample.csproj b/sample/AromaShooterControllerSample/ControllerSample.csproj new file mode 100644 index 0000000..43d5aaa --- /dev/null +++ b/sample/AromaShooterControllerSample/ControllerSample.csproj @@ -0,0 +1,98 @@ + + + + + Debug + AnyCPU + {FAAAF84F-AFEC-46D3-87C1-7F93CF11C0F8} + WinExe + Properties + ControllerSample + ControllerSample + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\libs\ASControllerSDK.dll + + + + + False + ..\..\libs\System.Runtime.WindowsRuntime.dll + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff --git a/sample/AromaShooterControllerSample/Form1.Designer.cs b/sample/AromaShooterControllerSample/Form1.Designer.cs new file mode 100644 index 0000000..6cd35ca --- /dev/null +++ b/sample/AromaShooterControllerSample/Form1.Designer.cs @@ -0,0 +1,126 @@ +namespace ControllerSample +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.Cartridge1 = new System.Windows.Forms.Button(); + this.Cartridge2 = new System.Windows.Forms.Button(); + this.Cartridge3 = new System.Windows.Forms.Button(); + this.Cartridge4 = new System.Windows.Forms.Button(); + this.Cartridge5 = new System.Windows.Forms.Button(); + this.Cartridge6 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // Cartridge1 + // + this.Cartridge1.Location = new System.Drawing.Point(23, 86); + this.Cartridge1.Name = "Cartridge1"; + this.Cartridge1.Size = new System.Drawing.Size(75, 23); + this.Cartridge1.TabIndex = 0; + this.Cartridge1.Text = "Cartridge1"; + this.Cartridge1.UseVisualStyleBackColor = true; + this.Cartridge1.Click += new System.EventHandler(this.Cartridge1_Click); + // + // Cartridge2 + // + this.Cartridge2.Location = new System.Drawing.Point(172, 86); + this.Cartridge2.Name = "Cartridge2"; + this.Cartridge2.Size = new System.Drawing.Size(75, 23); + this.Cartridge2.TabIndex = 1; + this.Cartridge2.Text = "Cartridge2"; + this.Cartridge2.UseVisualStyleBackColor = true; + this.Cartridge2.Click += new System.EventHandler(this.Cartridge2_Click); + // + // Cartridge3 + // + this.Cartridge3.Location = new System.Drawing.Point(325, 86); + this.Cartridge3.Name = "Cartridge3"; + this.Cartridge3.Size = new System.Drawing.Size(75, 23); + this.Cartridge3.TabIndex = 2; + this.Cartridge3.Text = "Cartridge3"; + this.Cartridge3.UseVisualStyleBackColor = true; + this.Cartridge3.Click += new System.EventHandler(this.Cartridge3_Click); + // + // Cartridge4 + // + this.Cartridge4.Location = new System.Drawing.Point(23, 152); + this.Cartridge4.Name = "Cartridge4"; + this.Cartridge4.Size = new System.Drawing.Size(75, 23); + this.Cartridge4.TabIndex = 3; + this.Cartridge4.Text = "Cartridge4"; + this.Cartridge4.UseVisualStyleBackColor = true; + this.Cartridge4.Click += new System.EventHandler(this.Cartridge4_Click); + // + // Cartridge5 + // + this.Cartridge5.Location = new System.Drawing.Point(172, 152); + this.Cartridge5.Name = "Cartridge5"; + this.Cartridge5.Size = new System.Drawing.Size(75, 23); + this.Cartridge5.TabIndex = 4; + this.Cartridge5.Text = "Cartridge5"; + this.Cartridge5.UseVisualStyleBackColor = true; + this.Cartridge5.Click += new System.EventHandler(this.Cartridge5_Click); + // + // Cartridge6 + // + this.Cartridge6.Location = new System.Drawing.Point(325, 152); + this.Cartridge6.Name = "Cartridge6"; + this.Cartridge6.Size = new System.Drawing.Size(75, 23); + this.Cartridge6.TabIndex = 5; + this.Cartridge6.Text = "Cartridge6"; + this.Cartridge6.UseVisualStyleBackColor = true; + this.Cartridge6.Click += new System.EventHandler(this.Cartridge6_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(422, 261); + this.Controls.Add(this.Cartridge6); + this.Controls.Add(this.Cartridge5); + this.Controls.Add(this.Cartridge4); + this.Controls.Add(this.Cartridge3); + this.Controls.Add(this.Cartridge2); + this.Controls.Add(this.Cartridge1); + this.Name = "Form1"; + this.Text = "AromaShooterControllerSample"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button Cartridge1; + private System.Windows.Forms.Button Cartridge2; + private System.Windows.Forms.Button Cartridge3; + private System.Windows.Forms.Button Cartridge4; + private System.Windows.Forms.Button Cartridge5; + private System.Windows.Forms.Button Cartridge6; + } +} + diff --git a/sample/AromaShooterControllerSample/Form1.cs b/sample/AromaShooterControllerSample/Form1.cs new file mode 100644 index 0000000..a1317c4 --- /dev/null +++ b/sample/AromaShooterControllerSample/Form1.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +/*Import Controller SDK*/ +using ASControllerSDK; + +namespace ControllerSample +{ + public partial class Form1 : Form + { + //Get AromaShooterController references + private AromaShooterController aromaShooterController = AromaShooterController.sharedInstance; + public Form1() + { + InitializeComponent(); + + //Initalize + aromaShooterController.setup(); + } + + /// + /// + /// Diffuse scent APIs + /// diffuse(duration,speed,ports) + /// - duration: time (unit: milliseconds) + /// - ports: Array of ports to diffuse at the same time. Port: 1~6 + /// - booster: To strong push aroma + /// + + + private void Cartridge1_Click(object sender, EventArgs e) + { + aromaShooterController.diffuse(3000, new int[] { 1 }, false); + } + + private void Cartridge2_Click(object sender, EventArgs e) + { + aromaShooterController.diffuse(3000, new int[] { 2}, true); + } + + private void Cartridge3_Click(object sender, EventArgs e) + { + aromaShooterController.diffuse(3000, new int[] { 3 }, true); + } + + private void Cartridge4_Click(object sender, EventArgs e) + { + aromaShooterController.diffuse(3000, new int[] { 4 }, true); + } + + private void Cartridge5_Click(object sender, EventArgs e) + { + aromaShooterController.diffuse(3000, new int[] { 5 }, true); + } + + private void Cartridge6_Click(object sender, EventArgs e) + { + aromaShooterController.diffuse(3000, new int[] { 6 }, true); + } + } +} diff --git a/sample/AromaShooterControllerSample/Form1.resx b/sample/AromaShooterControllerSample/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/sample/AromaShooterControllerSample/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/sample/AromaShooterControllerSample/Program.cs b/sample/AromaShooterControllerSample/Program.cs new file mode 100644 index 0000000..812f54c --- /dev/null +++ b/sample/AromaShooterControllerSample/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ControllerSample +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/sample/AromaShooterControllerSample/Properties/AssemblyInfo.cs b/sample/AromaShooterControllerSample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a964a79 --- /dev/null +++ b/sample/AromaShooterControllerSample/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using 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. +[assembly: AssemblyTitle("AromaShooterControllerSample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AromaShooterControllerSample")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("faaaf84f-afec-46d3-87c1-7f93cf11c0f8")] + +// 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")] diff --git a/sample/AromaShooterControllerSample/Properties/Resources.Designer.cs b/sample/AromaShooterControllerSample/Properties/Resources.Designer.cs new file mode 100644 index 0000000..410f5ff --- /dev/null +++ b/sample/AromaShooterControllerSample/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ControllerSample.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // 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. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ControllerSample.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/sample/AromaShooterControllerSample/Properties/Resources.resx b/sample/AromaShooterControllerSample/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/sample/AromaShooterControllerSample/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/sample/AromaShooterControllerSample/Properties/Settings.Designer.cs b/sample/AromaShooterControllerSample/Properties/Settings.Designer.cs new file mode 100644 index 0000000..6f0ebf1 --- /dev/null +++ b/sample/AromaShooterControllerSample/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ControllerSample.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/sample/AromaShooterControllerSample/Properties/Settings.settings b/sample/AromaShooterControllerSample/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/sample/AromaShooterControllerSample/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/sample/ControllerSample.sln b/sample/ControllerSample.sln new file mode 100644 index 0000000..f218b1f --- /dev/null +++ b/sample/ControllerSample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControllerSample", "AromaShooterControllerSample\ControllerSample.csproj", "{FAAAF84F-AFEC-46D3-87C1-7F93CF11C0F8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FAAAF84F-AFEC-46D3-87C1-7F93CF11C0F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FAAAF84F-AFEC-46D3-87C1-7F93CF11C0F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FAAAF84F-AFEC-46D3-87C1-7F93CF11C0F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FAAAF84F-AFEC-46D3-87C1-7F93CF11C0F8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal