diff --git a/VARP/OSC/Src/OscChannel.cs b/VARP/OSC/Src/OscChannel.cs index e10345b..892ccf1 100644 --- a/VARP/OSC/Src/OscChannel.cs +++ b/VARP/OSC/Src/OscChannel.cs @@ -1,4 +1,28 @@ -using System; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System; using System.Collections; using System.Collections.Generic; using UnityEditor; @@ -24,7 +48,7 @@ public enum Name C8 //< Channel 8 (Expansion) } - public Name channelName; //< Channe's name will be displayed on screen + public Name channelName; //< Channel's name will be displayed on screen public Text configText; //< The channel's text message public Text statusText; //< The channel's measurements text message public OscChannelLabel label; //< Label at left side of screen @@ -37,7 +61,7 @@ public enum Name public float trigLevel; //< Trigger threshold public bool isPlugged; - private Oscilloscope oscilloscope; //< Oscilloscope refference + private Oscilloscope oscilloscope; //< Oscilloscope reference private OscSettings oscSettings; private OscRenderer oscRenderer; private float chanLabelPosX; //< (Calculate) Coordinate of markers (Grid Divisions) @@ -123,8 +147,8 @@ private void UpdateLeds() // Acquire sample // ============================================================================================================= - public Vector3 sample; //< Curent sample - public Vector3 dclevel; //< Dc level for decouplig + public Vector3 sample; //< Current sample + public Vector3 dclevel; //< DC level for decoupling public OscProbe.ReadTriggerSampleDelegate readTriggerSample; //< Read sample for trigger public OscProbe.ReadSampleDelegate readSample; //< Read sample from this probe @@ -333,7 +357,7 @@ public void Clear() private float gain = 1; //< Values per division private float scale = 1f; private float position = 0f; //< Change vertical position of this diagram - private bool autoGain = false; //< Make this input autoscaled verticaly + private bool autoGain = false; //< Make this input auto-scaled vertically private bool decoupling; //< AC/DC coupling mode private OscProbe.Style style; //< Rendering style diff --git a/VARP/OSC/Src/OscChannelLabel.cs b/VARP/OSC/Src/OscChannelLabel.cs index 3c30463..54a2ba3 100644 --- a/VARP/OSC/Src/OscChannelLabel.cs +++ b/VARP/OSC/Src/OscChannelLabel.cs @@ -1,4 +1,28 @@ -using System.Collections; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; diff --git a/VARP/OSC/Src/OscCursorLabel.cs b/VARP/OSC/Src/OscCursorLabel.cs index 54e2fe8..c4cec3c 100644 --- a/VARP/OSC/Src/OscCursorLabel.cs +++ b/VARP/OSC/Src/OscCursorLabel.cs @@ -1,4 +1,28 @@ -using System.Collections; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; diff --git a/VARP/OSC/Src/OscGrid.cs b/VARP/OSC/Src/OscGrid.cs index 0d8b062..3388395 100644 --- a/VARP/OSC/Src/OscGrid.cs +++ b/VARP/OSC/Src/OscGrid.cs @@ -1,4 +1,28 @@ -using System.Collections; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Experimental.Rendering; @@ -12,7 +36,7 @@ public class OscGrid : MonoBehaviour public Color bgColor; public Color gridColor; private OscSettings oscSettings; - private RawImage screenImage; //< The image to draw osciloscope + private RawImage screenImage; //< The image to draw oscilloscope private Texture2D screenTexture; //< The texture used for screenImage private Color[] clearColors; //< The colors to clear screenTexture private bool redraw; @@ -30,8 +54,8 @@ public void Initialize(OscSettings oscSettings) this.oscSettings = oscSettings; screenImage = GetComponent(); drawGrid = oscSettings.drawGrid; - drawRullerX = oscSettings.drawRullerX; - drawRullerX = oscSettings.drawRullerY; + drawRulerX = oscSettings.drawRulerX; + drawRulerY = oscSettings.drawRulerY; redraw = true; } @@ -53,18 +77,18 @@ public bool DrawGrid set { drawGrid = value; redraw = true; } } - private bool drawRullerX; - public bool DrawRullerX + private bool drawRulerX; + public bool DrawRulerX { - get { return drawRullerX; } - set { drawRullerX = value; redraw = true; } + get { return drawRulerX; } + set { drawRulerX = value; redraw = true; } } - private bool drawRullerY; - public bool DrawRullerY + private bool drawRulerY; + public bool DrawRulerY { - get { return drawRullerY; } - set { drawRullerY = value; redraw = true; } + get { return drawRulerY; } + set { drawRulerY = value; redraw = true; } } // ============================================================================================ @@ -143,25 +167,25 @@ public void PlotGrid(Color color) PlotDotedLineHorizontal(screenTexture, xcenter, y, pxSub, color); } - if (drawRullerX) + if (drawRulerX) { - // -- draw horizontal ruller bar in center + // -- draw horizontal ruler bar in center PlotDotedLineHorizontal(screenTexture, xcenter, ycenter + 2, pxSub, color); PlotDotedLineHorizontal(screenTexture, xcenter, ycenter + 1, pxSub, color); PlotDotedLineHorizontal(screenTexture, xcenter, ycenter - 1, pxSub, color); PlotDotedLineHorizontal(screenTexture, xcenter, ycenter - 2, pxSub, color); } - if (drawRullerY) + if (drawRulerY) { - // -- draw verticals ruller bar in center + // -- draw verticals ruler bar in center PlotDotedLineVertical(screenTexture, xcenter + 2, ycenter, pxSub, color); PlotDotedLineVertical(screenTexture, xcenter + 1, ycenter, pxSub, color); PlotDotedLineVertical(screenTexture, xcenter - 1, ycenter, pxSub, color); PlotDotedLineVertical(screenTexture, xcenter - 2, ycenter, pxSub, color); } - // -- draw frame arounf + // -- draw frame around OscUtils.PlotRectangle(screenTexture, 0, 0, w - 1, h - 1, color); } @@ -171,7 +195,7 @@ public void PlotGrid(Color color) // ============================================================================================ /// - /// Draw horizontaly multiple dots as the ruller's divisions. Argumens are in pixel Units. + /// Draw horizontally multiple dots as the ruler's divisions. Arguments are in pixel Units. /// /// /// Line position @@ -196,7 +220,7 @@ public static void PlotDotedLineHorizontal(Texture2D texture, int x, int y, int } /// - /// Draw verticaly multiple dots as the ruller's divisions + /// Draw vertically multiple dots as the ruler's divisions /// /// /// Line position diff --git a/VARP/OSC/Src/OscGuiManager.cs b/VARP/OSC/Src/OscGuiManager.cs index eedb82f..c1d82a8 100644 --- a/VARP/OSC/Src/OscGuiManager.cs +++ b/VARP/OSC/Src/OscGuiManager.cs @@ -1,4 +1,28 @@ -using System.Collections; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; @@ -39,7 +63,7 @@ public class OscGuiManager : MonoBehaviour private const KeyCode buttonSelectModifyer1 = KeyCode.LeftShift; private const KeyCode buttonSelectModifyer2 = KeyCode.LeftShift; - // (computed) list of all obove + // (computed) list of all above private KeyCode[] buttonSelectKeys; /********************************************************** @@ -150,13 +174,13 @@ void Update() { gridSetting++; oscilloscope.grid.DrawGrid = (gridSetting & 1) > 0; - oscilloscope.grid.DrawRullerY = oscilloscope.grid.DrawRullerX = (gridSetting & 2) > 0; + oscilloscope.grid.DrawRulerY = oscilloscope.grid.DrawRulerX = (gridSetting & 2) > 0; } // the event for selected or trigger channel if (selectedChannel == null) { - // Joypad controll + // Joy pad control if (Input.GetKeyDown(buttonTimeScalePlus)) trigger.SecondsDivisionPlus(); else if (Input.GetKeyDown(buttonTimeScaleMinus)) @@ -186,7 +210,7 @@ void Update() else if (Input.GetKeyDown(buttonChannelView)) channel.Style = GetNextEnum(channel.Style); - // Joypad controll + // Joy pad control if (Input.GetKeyDown(buttonPosPlus)) channel.Position += 0.5f; else if (Input.GetKeyDown(buttonPosMinus)) @@ -287,7 +311,7 @@ void UpdateHelp() // The text messages for help // ============================================================================================================= - private readonly string toFocusHelp = "` activate keyboard shorcuts\n"; + private readonly string toFocusHelp = "` activate keyboard shortcuts\n"; private readonly string channelHelp = "1,2,..,8 select input\nA auto, C coupling\nU unplug, V view\nUP,DOWN position\n+,- gain\n"; private readonly string triggerHelp = "SHIFT+1,2,..,8 select input\nM mode, E edge\nUP,DOWN level\nLEFT,RIGHT time position\n+,- time scale"; private readonly string persistHelp = "PAUSE pause, S force start\n"; @@ -327,7 +351,7 @@ public void SelectTriggerChannel() public T GetNextEnum(T src) where T : struct { if (!typeof(T).IsEnum) - throw new System.ArgumentException(string.Format("Argumnent {0} is not an Enum", typeof(T).FullName)); + throw new System.ArgumentException(string.Format("Argument {0} is not an Enum", typeof(T).FullName)); T[] values = (T[]) System.Enum.GetValues(src.GetType()); var j = System.Array.IndexOf(values, src) + 1; @@ -337,7 +361,7 @@ public T GetNextEnum(T src) where T : struct public T GetPrevEnum(T src) where T : struct { if (!typeof(T).IsEnum) - throw new System.ArgumentException(string.Format("Argumnent {0} is not an Enum", typeof(T).FullName)); + throw new System.ArgumentException(string.Format("Argument {0} is not an Enum", typeof(T).FullName)); T[] values = (T[]) System.Enum.GetValues(src.GetType()); var j = System.Array.IndexOf(values, src) - 1; diff --git a/VARP/OSC/Src/OscLabelManager.cs b/VARP/OSC/Src/OscLabelManager.cs index c721f73..7f17ade 100644 --- a/VARP/OSC/Src/OscLabelManager.cs +++ b/VARP/OSC/Src/OscLabelManager.cs @@ -1,4 +1,28 @@ -using System; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; diff --git a/VARP/OSC/Src/OscLed.cs b/VARP/OSC/Src/OscLed.cs index b242c4c..46d6349 100644 --- a/VARP/OSC/Src/OscLed.cs +++ b/VARP/OSC/Src/OscLed.cs @@ -1,4 +1,28 @@ -using System.Collections; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; diff --git a/VARP/OSC/Src/OscMinMax.cs b/VARP/OSC/Src/OscMinMax.cs index bcff491..49610c0 100644 --- a/VARP/OSC/Src/OscMinMax.cs +++ b/VARP/OSC/Src/OscMinMax.cs @@ -1,4 +1,28 @@ -using System; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -10,7 +34,7 @@ public struct OscMinMax private bool isZero; private float min; // minimum private float max; // maximum - private float p2p; // peak to peak + private float p2p; // peak to peak public float Min => isZero ? 0 : min; public float Max => isZero ? 0 : max; diff --git a/VARP/OSC/Src/OscProbe.cs b/VARP/OSC/Src/OscProbe.cs index dfd5fd6..bca35a8 100644 --- a/VARP/OSC/Src/OscProbe.cs +++ b/VARP/OSC/Src/OscProbe.cs @@ -1,4 +1,28 @@ -using System.Collections; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -7,7 +31,7 @@ namespace VARP.OSC /// /// The base class for all input. It is model of the oscilloscope's cable probe. /// Also it has default settings for oscilloscope's channel. And when we will - /// plug input to the channel those settings will be applayed to the channel. + /// plug input to the channel those settings will be applied to the channel. /// public class OscProbe { @@ -18,16 +42,16 @@ public class OscProbe ***********************************************/ public float position = 0f; //< Change vertical position of this diagram (divisions) - public bool autoGain = false; //< Audoset best gain for this probe - public int autoGainDivisions = 2; //< Audoset gain will try to fit diagram to X divisions + public bool autoGain = false; //< Auto set best gain for this probe + public int autoGainDivisions = 2; //< Auto set gain will try to fit diagram to X divisions /*********************************************** * Settings for the OscTrigger ***********************************************/ - public OscTrigger.TriggerMode Mode; //< Trigger mode will be copyied to the OscTrigger - public OscTrigger.TriggerEdge Edge; //< Trigger edge will be copyied to the OscTrigger - public float triggerLevel; //< Trigger level will be copyied to the OscTrigger + public OscTrigger.TriggerMode Mode; //< Trigger mode will be copied to the OscTrigger + public OscTrigger.TriggerEdge Edge; //< Trigger edge will be copied to the OscTrigger + public float triggerLevel; //< Trigger level will be copied to the OscTrigger /*********************************************** * Decoupling diff --git a/VARP/OSC/Src/OscRenderer.cs b/VARP/OSC/Src/OscRenderer.cs index 702f32b..b0ce677 100644 --- a/VARP/OSC/Src/OscRenderer.cs +++ b/VARP/OSC/Src/OscRenderer.cs @@ -1,4 +1,28 @@ -using System; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System; using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -11,7 +35,7 @@ public class OscRenderer : MonoBehaviour { public enum Mode { - Default, //< Default oscilloscope diagramm + Default, //< Default oscilloscope diagram } public Color colorX = Color.red; //< Draw vector data with this colors @@ -23,7 +47,7 @@ public enum Mode private Texture2D screenTexture; //< The texture used for screenImage private Color[] clearColors; //< The colors to clear screenTexture private OscSettings oscSettings; //< Oscilloscope settings - public bool heartBeat; //< To make gui elements blinkh + public bool heartBeat; //< To make GUI elements blink /// Use this for initialization /// Divisions of X axis @@ -75,7 +99,7 @@ private void CreateTexture(int w, int h, Color color) } /// - /// Clear horizintal block of texture + /// Clear horizontal block of texture /// /// Start pixel /// End pixel diff --git a/VARP/OSC/Src/OscSettings.cs b/VARP/OSC/Src/OscSettings.cs index 530ebb9..5d7f7b8 100644 --- a/VARP/OSC/Src/OscSettings.cs +++ b/VARP/OSC/Src/OscSettings.cs @@ -1,4 +1,28 @@ -using UnityEngine; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using UnityEngine; namespace VARP.OSC { @@ -22,14 +46,14 @@ public class OscSettings : ScriptableObject // Fiels for designer // ============================================================================================================= - public int pixelsPerDivision = 50; //< How many pixels in single division (recomend 10,20,30,...) - public int divisionsX = 11; //< Horizontal divisions (Recomend odd value) - public int divisionsY = 11; //< Vertical divisions (Recomend odd value) - public int subdivisions = 5; //< Subdivisions in the division (Recomend 5 or 10) + public int pixelsPerDivision = 50; //< How many pixels in single division (recommend 10,20,30,...) + public int divisionsX = 11; //< Horizontal divisions (Recommend odd value) + public int divisionsY = 11; //< Vertical divisions (Recommend odd value) + public int subdivisions = 5; //< Subdivisions in the division (Recommend 5 or 10) [Header("Grid options")] public bool drawGrid = true; //< Draw grid - public bool drawRullerX = true; //< Draw horizontal ruller in center - public bool drawRullerY = true; //< Draw vertical ruller in center + public bool drawRulerX = true; //< Draw horizontal ruler in center + public bool drawRulerY = true; //< Draw vertical ruler in center [Header("Calculated")] public int pixelsPerSubdivision; //< (Calculated) How many pixels in subdivision public Vector2Int textureSize; //< (Calculated) Texture size in pixels diff --git a/VARP/OSC/Src/OscTrigger.cs b/VARP/OSC/Src/OscTrigger.cs index f23f6d2..07cc0ea 100644 --- a/VARP/OSC/Src/OscTrigger.cs +++ b/VARP/OSC/Src/OscTrigger.cs @@ -1,4 +1,28 @@ -using System; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System; using System.Collections; using System.Collections.Generic; using System.Xml; @@ -253,7 +277,7 @@ public void UpdateTrigger() // finish render of screen dmaDraw = RenderSamples(dmaDraw, dmaWrite-1); dmaWrite &= BUFFER_INDEX_MASK; - // go to nexr state depend on curent mode + // go to nexr state depend on current mode switch (mode) { case TriggerMode.Auto: @@ -276,7 +300,7 @@ public void UpdateTrigger() dmaDraw = RenderSamples(dmaDraw, dmaWrite-1); } break; - case Status.Auto: /* Record and display on screen all what acuired */ + case Status.Auto: /* Record and display on screen all what acquired */ AquireSampe(); // test if we fill the buffer for all screen then finish render of screen if (dmaWrite > dmaWriteEnd) @@ -324,7 +348,7 @@ private void TriggerIt() /// Detect the start/stop events for oscilloscope private bool ReadTrigger() { - // try to trigger the sampling it depends on curent mode. + // try to trigger the sampling it depends on current mode. switch (mode) { case TriggerMode.Auto: @@ -384,8 +408,8 @@ public enum TriggerMode /// Available trigger edge detection modes public enum TriggerEdge { - Rising, //< When signal more than treshold - Falling, //< When signal less than treshold + Rising, //< When signal more than threshold + Falling, //< When signal less than threshold } /// Trigger status @@ -418,8 +442,8 @@ public enum Status } - public Status status; //< Curent status of trigger - public float level; //< The treshold value to detect trigger + public Status status; //< Current status of trigger + public float level; //< The threshold value to detect trigger public Text configText; //< The channel's text message public Image iconStateArmed; public Image iconStateAuto; @@ -445,8 +469,8 @@ public enum Status // Dirty flags // ============================================================================================================= - private bool isDirtyConfigText; //< Required rebuld config text - private bool isDirtyStatusText; //< Required rebuld statuc text + private bool isDirtyConfigText; //< Required rebuild configuration text + private bool isDirtyStatusText; //< Required rebuild status text // ============================================================================================================= // Timing labels @@ -524,7 +548,7 @@ public void SecondsDivisionMinus() // ============================================================================================================= /// - /// Positive values move diagram to the left. Untits DIVISIONS + /// Positive values move diagram to the left. Units DIVISIONS /// Other way to think about is the time in center of screen. /// public float Position @@ -599,7 +623,7 @@ public TriggerMode Mode set { SetMode(value); } } - /// Set curent mode + /// Set current mode public void SetMode(TriggerMode triggerMode) { // change the mode @@ -643,7 +667,7 @@ public void ForceTrigger() private int dmaDraw; //< Number of sample for rendering private int dmaDrawBeg; //< Begin of rendering private int dmaDrawEnd; //< End of rendering - private int dmaWrite; //< Number of sample for aquiring + private int dmaWrite; //< Number of sample for acquiring private int dmaWriteTrggrd; //< Store dmaWrite when triggered private int dmaWriteEnd; //< Store dmaWrite when triggered private float trigSample1; //< Previous trigger sample diff --git a/VARP/OSC/Src/OscUtils.cs b/VARP/OSC/Src/OscUtils.cs index 988ca2a..d0fd5b2 100644 --- a/VARP/OSC/Src/OscUtils.cs +++ b/VARP/OSC/Src/OscUtils.cs @@ -1,4 +1,28 @@ -using System.Collections; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System.Collections; using System.Collections.Generic; using UnityEngine; diff --git a/VARP/OSC/Src/Oscilloscope.cs b/VARP/OSC/Src/Oscilloscope.cs index 35e21c7..ea0d1f8 100644 --- a/VARP/OSC/Src/Oscilloscope.cs +++ b/VARP/OSC/Src/Oscilloscope.cs @@ -1,4 +1,28 @@ -using System; +// ============================================================================= +// MIT License +// +// Copyright (c) [2018] [Valeriya Pudova] +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// ============================================================================= + +using System; using System.Collections; using System.Collections.Generic; using System.Security.Principal; @@ -27,7 +51,7 @@ public class Oscilloscope : MonoBehaviour public OscTrigger trigger; //< The trigger object [Header("Vetical")] - public OscChannel[] oscChannels; //< The osciloscope's channels + public OscChannel[] oscChannels; //< The oscilloscope's channels [Header("Grid")] public OscGrid grid; //< The grid of oscilloscope