public void SaveMapping() { backupMapping = mapping.Clone(); try { if (mapping == null) { return; } String mappingFilePath = GetMappingFilePath(); XmlSerializer serializer = new XmlSerializer(typeof(InputControls)); using (System.IO.TextWriter textWriter = new System.IO.StreamWriter(mappingFilePath)) { serializer.Serialize(textWriter, mapping.Controls); textWriter.Close(); } } catch (Exception e) { throw new Exception("There was an error while writing the input mapping for device \"" + DeviceName + "\": " + e.Message); } }
public InputMapping Clone() { InputMapping clonedMapping = new InputMapping(validButtons, validAxes); clonedMapping.SetButtonMappings(controls.CameraSwapButton, controls.TakeOffButton, controls.LandButton, controls.HoverButton, controls.EmergencyButton, controls.FlatTrimButton); clonedMapping.SetAxisMappings(controls.RollAxisMapping, controls.PitchAxisMapping, controls.YawAxisMapping, controls.GazAxisMapping); return(clonedMapping); }
protected void CreateMapping(List<String> validButtons, List<String> validAxes) { mapping = new InputMapping(validButtons, validAxes); if (!LoadMapping()) { CreateStandardMapping(); } backupMapping = mapping.Clone(); }
protected void CreateMapping(List <String> validButtons, List <String> validAxes) { mapping = new InputMapping(validButtons, validAxes); if (!LoadMapping()) { CreateStandardMapping(); } backupMapping = mapping.Clone(); }
public void DetermineMapping() { serializationUtils = new SerializationUtils(); mapping = GetStandardMapping(); LoadMapping(); backupMapping = mapping.Clone(); }
public void SaveMapping() { backupMapping = mapping.Clone(); try { if (mapping == null) { return; } String mappingFilePath = GetMappingFilePath(); DictionarySerializer.Serialize(mapping.Controls.Mappings, mappingFilePath); } catch (Exception e) { throw new Exception("There was an error while writing the input mapping for device \"" + DeviceName + "\": " + e.Message); } }
public InputMapping Clone() { InputMapping clonedMapping = new InputMapping(validButtons, validAxes); clonedMapping.SetButtonMappings(controls.CameraSwapButton, controls.TakeOffButton, controls.LandButton, controls.HoverButton, controls.EmergencyButton, controls.FlatTrimButton); clonedMapping.SetAxisMappings(controls.RollAxisMapping, controls.PitchAxisMapping, controls.YawAxisMapping, controls.GazAxisMapping); return clonedMapping; }
public void CopyMappingsFrom(InputMapping mapping) { SetButtonMappings(mapping.CameraSwapButton, mapping.TakeOffButton, mapping.LandButton, mapping.HoverButton, mapping.EmergencyButton, mapping.FlatTrimButton); SetAxisMappings(mapping.RollAxisMapping, mapping.PitchAxisMapping, mapping.YawAxisMapping, mapping.GazAxisMapping); }
public void SetDefaultMapping() { CreateStandardMapping(); backupMapping = mapping.Clone(); }
private void TakeOverMapping(InputMapping mapping) { textBoxAxisRoll.Text = mapping.RollAxisMapping; textBoxAxisPitch.Text = mapping.PitchAxisMapping; textBoxAxisYaw.Text = mapping.YawAxisMapping; textBoxAxisGaz.Text = mapping.GazAxisMapping; textBoxButtonTakeOff.Text = mapping.TakeOffButton; textBoxButtonLand.Text = mapping.LandButton; textBoxButtonHover.Text = mapping.HoverButton; textBoxButtonEmergency.Text = mapping.EmergencyButton; textBoxButtonFlatTrim.Text = mapping.FlatTrimButton; textBoxButtonChangeCamera.Text = mapping.CameraSwapButton; CheckForDoubleInput(); }
public GenericInput() { mapping = new InputMapping(new List <String>(), new List <String>()); backupMapping = mapping.Clone(); }
public void CopyValidButtonsAndAxesFrom(InputMapping mappingToCopyFrom) { validButtons = mappingToCopyFrom.ValidButtons; validAxes = mappingToCopyFrom.ValidAxes; }
public void CopyMappingFrom(ConfigurableInput input) { mapping = input.mapping.Clone(); backupMapping = input.backupMapping.Clone(); }
public void SetDefaultMapping() { mapping = GetStandardMapping(); backupMapping = mapping.Clone(); }
public void RevertMapping() { mapping = backupMapping.Clone(); }
public void CopyMappingFrom(GenericInput input) { mapping = input.mapping.Clone(); backupMapping = input.backupMapping.Clone(); }
public GenericInput() { mapping = new InputMapping(new List<String>(), new List<String>()); backupMapping = mapping.Clone(); }
private void UpdateMapping(InputMapping mapping, Control control, String inputValue) { if (control == Control.AxisRoll) { mapping.RollAxisMapping = inputValue; } if (control == Control.AxisPitch) { mapping.PitchAxisMapping = inputValue; } if (control == Control.AxisYaw) { mapping.YawAxisMapping = inputValue; } if (control == Control.AxisGaz) { mapping.GazAxisMapping = inputValue; } if (control == Control.ButtonTakeoff) { mapping.TakeOffButton = inputValue; } if (control == Control.ButtonLand) { mapping.LandButton = inputValue; } if (control == Control.ButtonHover) { mapping.HoverButton = inputValue; } if (control == Control.ButtonEmergency) { mapping.EmergencyButton = inputValue; } if (control == Control.ButtonFlatTrim) { mapping.FlatTrimButton = inputValue; } if (control == Control.ButtonChangeCamera) { mapping.CameraSwapButton = inputValue; } }