Skip to content

Commit

Permalink
Lisense added
Browse files Browse the repository at this point in the history
  • Loading branch information
hww committed Oct 29, 2018
1 parent e287457 commit 2c67341
Show file tree
Hide file tree
Showing 14 changed files with 409 additions and 73 deletions.
36 changes: 30 additions & 6 deletions VARP/OSC/Src/OscChannel.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
26 changes: 25 additions & 1 deletion VARP/OSC/Src/OscChannelLabel.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
26 changes: 25 additions & 1 deletion VARP/OSC/Src/OscCursorLabel.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
62 changes: 43 additions & 19 deletions VARP/OSC/Src/OscGrid.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -30,8 +54,8 @@ public void Initialize(OscSettings oscSettings)
this.oscSettings = oscSettings;
screenImage = GetComponent<RawImage>();
drawGrid = oscSettings.drawGrid;
drawRullerX = oscSettings.drawRullerX;
drawRullerX = oscSettings.drawRullerY;
drawRulerX = oscSettings.drawRulerX;
drawRulerY = oscSettings.drawRulerY;
redraw = true;
}

Expand All @@ -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; }
}

// ============================================================================================
Expand Down Expand Up @@ -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);

}
Expand All @@ -171,7 +195,7 @@ public void PlotGrid(Color color)
// ============================================================================================

/// <summary>
/// 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.
/// </summary>
/// <param name="color"></param>
/// <param name="x">Line position</param>
Expand All @@ -196,7 +220,7 @@ public static void PlotDotedLineHorizontal(Texture2D texture, int x, int y, int
}

/// <summary>
/// Draw verticaly multiple dots as the ruller's divisions
/// Draw vertically multiple dots as the ruler's divisions
/// </summary>
/// <param name="color"></param>
/// <param name="x">Line position</param>
Expand Down
40 changes: 32 additions & 8 deletions VARP/OSC/Src/OscGuiManager.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;

/**********************************************************
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -186,7 +210,7 @@ void Update()
else if (Input.GetKeyDown(buttonChannelView))
channel.Style = GetNextEnum<OscProbe.Style>(channel.Style);

// Joypad controll
// Joy pad control
if (Input.GetKeyDown(buttonPosPlus))
channel.Position += 0.5f;
else if (Input.GetKeyDown(buttonPosMinus))
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -327,7 +351,7 @@ public void SelectTriggerChannel()
public T GetNextEnum<T>(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<T>(values, src) + 1;
Expand All @@ -337,7 +361,7 @@ public T GetNextEnum<T>(T src) where T : struct
public T GetPrevEnum<T>(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<T>(values, src) - 1;
Expand Down
26 changes: 25 additions & 1 deletion VARP/OSC/Src/OscLabelManager.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading

0 comments on commit 2c67341

Please sign in to comment.