示例#1
0
        private void initialiseInput()
        {
            // Initialise the input object used to get the HaptiQs positions in space
            _input = InputFactory.getInputObj(_windowName, _inputClass);
            if (_input == null)
            {
                Helper.Logger("HaptiQ_API.HaptiQsManager.initialiseInput:: Cannot create a valid object of type " + _inputClass);
                throw new NullReferenceException("HaptiQ_API.HaptiQsManager.initialiseInput:: Cannot create a valid object of type " + _inputClass);
            }
            else
            {
                Helper.Logger("HaptiQ_API.HaptiQsManager.initialiseInput:: Input object created");
            }

            // [ HACK ] - Possible to register glyph not from here? 
            foreach (KeyValuePair<uint, HaptiQ> entry in _HaptiQsDictionary)
            {
                if (entry.Value.configuration.inputIdentifier.getType() == InputIdentifier.TYPE.glyph)
                {
                    GlyphsInput.registerGlyph(InputIdentifier.intToBinaryArray(entry.Value.configuration.inputIdentifier.getID(), entry.Value.configuration.inputIdentifier.getDim()));
                }
            }
 
            _input.Changed += new ChangedEventHandler(InputChanged);
        }
示例#2
0
 private void acquireInputIdentifierClick(object sender, EventArgs e)
 {
     
     InputIdentifier.TYPE typeItem = InputIdentifier.stringToType((String)InputIdentifiersComboBox.SelectedItem);
     if (_input != null)
     {
         _input.Changed -= new ChangedEventHandler(InputChanged); 
     }
     switch (typeItem)
     {
         case InputIdentifier.TYPE.tag:
             _input = InputFactory.getInputObj(_windowName, "SurfaceInput");
             break;
         case InputIdentifier.TYPE.glyph:
             _input = InputFactory.getInputObj(_windowName, "SurfaceGlyphsInput");
             break;
         default:
             Helper.Logger("HaptiQ_API.ConfigurationForm.acquireInputIdentifierClick:: input type unknown " + typeItem);
             break;
     }
     if (_input != null)
     {
         _input.Changed += new ChangedEventHandler(InputChanged);
     }
      
 }