Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        body.Attributes.Add("data-user-id", ((SunamoPage)Page).idLoginedUser.ToString());
        if (txtSearchText.Value != "")
        {
            string red = "http://" + Request.Url.Host + "/Lyrics/Search/" + UH.UrlEncode(txtSearchText.Value.Replace(".", "-")).Replace('+', ' ');
            ((SunamoPage)Page).WriteToDebugWithTime(red);
        }

        footer.InnerHtml = SunamoPageHelper.GetFooterHtml(MySites.Lyrics);

        imgColorPiano.Src = web.UH.GetWebUri(this.Page, "css/Lyr/colorpiano.png");
        aHome.HRef        = web.UH.GetWebUri(this.Page, "Lyrics/Home");

        MasterPageHelper.WriteGeneralCode(this.Page, false, true);
        SunamoCzMetroUIHelper.SetHtmlMetroUpperBarV3(this, horniLista, MySites.Lyrics);

        btnLogOut.ServerClick += new EventHandler(btnLogOut_ServerClick);
        btnLogIn.ServerClick  += new EventHandler(btnLogIn_ServerClick);

        LoginedUser pu = SessionManager.GetLoginedUser(Page);

        if (pu.login != "")
        {
            loginForm.Visible = false;
            logined.Visible   = true;
        }
        else
        {
            loginForm.Visible = true;
            logined.Visible   = false;
        }
    }
Example #2
0
    void Start()
    {
        print("Opening UH");
        int flags = UH.CONTINUOUS_MODE_QUATERNION | UH.CONTINUOUS_MODE_PHOTOREFLECTOR;

        UH.open(serial_port_name, flags);
    }
Example #3
0
    public void GetUriSafeStringTest()
    {
        var input    = "AttributeValueOfHtmlUC";
        var expected = "attribute-value-of-html-uc";

        var actual = UH.GetUriSafeString(input);

        Assert.Equal(expected, actual);
    }
Example #4
0
    public void GetFileNameTest()
    {
        var input  = @"https://lyrics.sunamo.cz/Me/Login.aspx?ReturnUrl=https://lyrics.sunamo.cz/Artist/walk-the-moon";
        var actual = UH.GetFileName(input);

        var excepted = "Login.aspx";

        Assert.Equal(excepted, actual);
    }
Example #5
0
    public void IsValidUriAndDomainIsTest()
    {
        var input    = "naradi-pajky.cz";
        var expected = true;

        bool surelyDomain;
        var  actual = UH.IsValidUriAndDomainIs(input, "*", out surelyDomain);

        Assert.Equal(expected, actual);
    }
Example #6
0
    // Use this for initialization
    void Start()
    {
        // Create Log file name
        DateTime currentDateTime = DateTime.Now.ToLocalTime();

        mLogFileName = String.Format("{0}.txt", getCurrentDateTimeText());

        mUnlimitedHand = UH.global;
        mUHController  = UHController.global;
        ChangeAngle(mCurrentAngle);
    }
Example #7
0
    public void UrlEncodeTest()
    {
        /*
         * Pokud správně užívám UrlEncode/Decode ani plus ve vstupním řetězci nemůže způsobit žádné škody
         *
         */

        var input   = @"a%+ b";
        var encoded = UH.UrlEncode(input);
        var decoded = UH.UrlDecode(encoded);

        Assert.Equal(input, decoded);
    }
    /////////////////////////////////////////////////////
    /// START
    /////////////////////////////////////////////////////
    private void Start()
    {
        /****  Additional Code for UnlimitedHand  ********************************/
        mPRCalib      = true;
        isStimulating = false;

        count         = 1;
        mCalibCount   = 0;
        mPRVARSum     = 0;
        PRVARSumAVE   = 0;
        PRVARSumCount = 0;
        /****  End of the Additional Code for UnlimitedHand  **********************/

        mUH = UH.global;
    }
Example #9
0
    public int EMS_sharpnessLevel;  // the sharpness level of EMS

    /////////////////////////////////////////////////////
    /// AWAKE
    /////////////////////////////////////////////////////
    void Awake()
    {
        Debug.Log("UnlimitedHand awake");
        if (instance == null)
        {
            instance = this;
        }
        DontDestroyOnLoad(this);

        //Serial Connection
        if (AutoConnect)
        {
            Debug.Log("AutoConnecting...");
            if (PortName == null || PortName.Length == 0 && UH.guessPortName().Length > 0)
            {
                PortName = UH.guessPortName();
            }
            Connect();
        }

        //Initializes objects to get the forearm angle data
        for (int i = 0; i < 7; i++)
        {
            UHGyroAccelData[i] = 0.0f;
        }
        updateAnglePRFlg   = false;
        updateAngleTempFlg = false;
        //Initializes objects to get the hand movements data
        for (int i = 0; i < 8; i++)
        {
            UHPR[i] = 0;
        }
        updatePhotoSensorsFlg = false;

        //Initializes objects to get the forearm Quaternion data
        updateQuaternionFlg = false;

        //Initializes objects: the voltage level(Stimulation Level) of EMS
        EMS_voltageLevel = 8;
        //Initializes objects: the sharpness level of EMS
        EMS_sharpnessLevel = 15;
    }
Example #10
0
 public void GetHostTest()
 {
     var actual = UH.GetHost(uri); DebugLogger.Instance.WriteLine("GetHost" + ": " + actual);
 }
Example #11
0
 public void GetQueryAsHttpRequestTest()
 {
     var actual = UH.GetQueryAsHttpRequest(urio); DebugLogger.Instance.WriteLine("GetQueryAsHttpRequest" + ": " + actual);
 }
Example #12
0
    void Update()
    {
        //print ("Reading from UH...");

        if (UH.exists(serial_port_name))
        {
            //Set object rotation to match UHs rotation
            transform.rotation = UH.rotation(serial_port_name);
            print("Rotation UH...");

            //Set color from Photo Reflector values
            double[] photo_reflectors = UH.photoReflectors(serial_port_name);
            Vector3  color_vec;
            color_vec.x = (float)photo_reflectors[0];
            color_vec.y = (float)photo_reflectors[1];
            color_vec.z = (float)photo_reflectors[2];
            color_vec.Normalize();
            Color main_color = Color.red;
            main_color.r = color_vec.x;
            main_color.g = color_vec.y;
            main_color.b = color_vec.z;
            main_color.a = 1;
            Renderer rend = GetComponent <Renderer> ();
            rend.material.shader = Shader.Find("Specular");
            rend.material.SetColor("_Color", main_color);


            if (Input.GetKeyDown(KeyCode.Alpha0))
            {
                UH.stimulateChannel(serial_port_name, 0);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha1))
            {
                UH.stimulateChannel(serial_port_name, 1);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha2))
            {
                UH.stimulateChannel(serial_port_name, 2);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha3))
            {
                UH.stimulateChannel(serial_port_name, 3);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha4))
            {
                UH.stimulateChannel(serial_port_name, 4);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha5))
            {
                UH.stimulateChannel(serial_port_name, 5);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha6))
            {
                UH.stimulateChannel(serial_port_name, 6);
            }
            else if (Input.GetKeyDown(KeyCode.Alpha7))
            {
                UH.stimulateChannel(serial_port_name, 7);
            }
        }
    }
Example #13
0
 void btnLogOut_ServerClick(object sender, EventArgs e)
 {
     ((SunamoPage)Page).WriteToDebugWithTime("/Me/Logout.aspx?ReturnUrl=" + UH.UrlEncode(this.Request.RawUrl));
 }
Example #14
0
 public void GetDirectoryNameTest()
 {
     var actual = UH.GetDirectoryName(uri); DebugLogger.Instance.WriteLine("GetDirectoryNameTest" + ": " + actual);
 }
Example #15
0
 void OnDestroy()
 {
     print("Closing UH");
     UH.close(serial_port_name);
 }
Example #16
0
 public void GetExtensionTest()
 {
     var actual = UH.GetExtension(uri); DebugLogger.Instance.WriteLine("GetExtension" + ": " + actual);
 }
Example #17
0
 public void GetProtocolStringTest()
 {
     var actual = UH.GetProtocolString(urio); DebugLogger.Instance.WriteLine("GetProtocolStringTest" + ": " + actual);
 }
Example #18
0
 public void GetPageNameFromUriTest()
 {
     var actual = UH.GetPageNameFromUri(urio); DebugLogger.Instance.WriteLine("GetPageNameFromUriTest" + ": " + actual);
 }
 // Use this for initialization
 void Start()
 {
     mUnlimitedHand = UH.global;
 }