예제 #1
0
 public void WriteData(PulseSetting obj)
 {
     _config.AppSettings.Settings[ConfigurationKey.MACHINE_ID].Value   = obj.MachineId;
     _config.AppSettings.Settings[ConfigurationKey.MACHINE_NAME].Value = obj.MachineName;
     _config.AppSettings.Settings[ConfigurationKey.SERVER_URI].Value   = obj.ServerUri;
     _config.AppSettings.Settings[ConfigurationKey.WEBAPI_URI].Value   = obj.WebApiUri;
     _config.AppSettings.Settings[ConfigurationKey.COUNTRY].Value      = obj.CountryName;
     _config.AppSettings.Settings[ConfigurationKey.GROUP_NAME].Value   = obj.GroupName;
     _config.Save(ConfigurationSaveMode.Modified);
 }
예제 #2
0
    public void SetData(PulseSetting pulseSetting)
    {
        oscAddressField.text = pulseSetting.OscAddress;
        oscDataField.text    = pulseSetting.OscData;

        overrideIpField.text = pulseSetting.OverrideIP;

        timecodeHourInputField.text   = pulseSetting.Timecode.hour.ToString();
        timecodeMinuteInputField.text = pulseSetting.Timecode.minute.ToString();
        timecodeSecondInputField.text = pulseSetting.Timecode.second.ToString();
        timecodeFrameInputField.text  = pulseSetting.Timecode.frame.ToString();
    }
예제 #3
0
        private PulseSetting GetOwinConfiguration()
        {
            var settings = _config.GetSection("appSettings") as AppSettingsSection;

            var obj = new PulseSetting
            {
                ServerUri   = settings.Settings[ConfigurationKey.SERVER_URI].Value,
                WebApiUri   = settings.Settings[ConfigurationKey.WEBAPI_URI].Value,
                MachineId   = settings.Settings[ConfigurationKey.MACHINE_ID].Value,
                MachineName = settings.Settings[ConfigurationKey.MACHINE_NAME].Value,
                CountryName = settings.Settings[ConfigurationKey.COUNTRY].Value,
                GroupName   = settings.Settings[ConfigurationKey.GROUP_NAME].Value,
            };

            return(obj);
        }
예제 #4
0
    public static PulseSetting Load(int index)
    {
        var pulseSetting = new PulseSetting(
            index,
            PlayerPrefs.GetString($"OscAddress_{index}"),
            PlayerPrefs.GetString($"OscData_{index}"),
            PlayerPrefs.GetString($"OverrideIP_{index}"),
            new Timecode
        {
            dropFrame = false,
            hour      = PlayerPrefs.GetInt($"Hour_{index}"),
            minute    = PlayerPrefs.GetInt($"Minute_{index}"),
            second    = PlayerPrefs.GetInt($"Second_{index}"),
            frame     = PlayerPrefs.GetInt($"Frame_{index}")
        }
            );

        return(pulseSetting);
    }
예제 #5
0
    public void Save(int index)
    {
        pulseSetting = new PulseSetting(
            index,
            _pulseSettingView.oscAddressField.text,
            _pulseSettingView.oscDataField.text,
            _pulseSettingView.overrideIpField.text,
            new Timecode
        {
            dropFrame = false,
            frame     = int.Parse(_pulseSettingView.timecodeFrameInputField.text),
            hour      = int.Parse(_pulseSettingView.timecodeHourInputField.text),
            minute    = int.Parse(_pulseSettingView.timecodeMinuteInputField.text),
            second    = int.Parse(_pulseSettingView.timecodeSecondInputField.text),
        }
            );

        pulseSetting.Save();
        _pulseSettingView.SetSaved();
    }
예제 #6
0
 public void Load(int index)
 {
     pulseSetting = PulseSetting.Load(index);
     _pulseSettingView.SetData(pulseSetting);
 }