Example #1
0
 public void cmd_SaveGenSettings(Settings._GenSettings gs)
 {
     Settings.GenSets = gs;
     Settings.SaveSettings();
 }
Example #2
0
        private void ModelChanged(object sender, PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
            case "Rigs": {
                Rigs      = new ObservableCollection <Settings.Rig>(_model.Rigs);
                RigsNames = from r in Rigs orderby r.Index select r.Name;
                for (int i = 0; i < RigsNames.Count(); i++)
                {
                    Indicators.Add(RigStatus.offline);
                    Watch.Add(Rigs[i].Waching);
                    {
                        if (Rigs[i].Waching)
                        {
                            AddRigPanel(i);
                        }
                        else
                        {
                            RemoveRigPanel(i);
                        }
                    }
                }
            } break;

            case "PoolsSets":
            {
                for (int i = 0; i < _model.PoolsSets.Count; i++)
                {
                    Selection.Add(false);
                    PoolsSets.Add(_model.PoolsSets[i]);
                    if (_model.PoolsSets[i].Wach)
                    {
                        WachPoolStart(i);
                    }
                }
            } break;

            case "GenSettings": {
                GenSettings = _model.GenSettings;

                StartOfRange  = GenSettings.TotalMinTemp;
                StartOfRangeD = GenSettings.TotalMinTemp;
                EndOfRange    = GenSettings.TotalMaxTemp;
                EndOfRangeD   = GenSettings.TotalMaxTemp;

                eWeLogin        = GenSettings.eWeLogin;
                eWePasswordSend = GenSettings.eWePassword;
                if (!String.IsNullOrEmpty(eWeLogin) && !String.IsNullOrEmpty(eWePasswordSend))
                {
                    Task.Run(() => eWeConnect());
                }

                Task.Run(() =>
                    {
                        if (!string.IsNullOrEmpty(GenSettings.HiveLogin) && !string.IsNullOrEmpty(GenSettings.HivePassword))
                        {
                            AuthenticationStatus st = HiveClient.HiveAuthentication(
                                GenSettings.HiveLogin, GenSettings.HivePassword);
                            if (st.Status)
                            {
                                HiveLogin           = GenSettings.HiveLogin;
                                HivePasswordSend    = GenSettings.HivePassword;
                                HiveConnection      = true;
                                App.HiveConnection  = true;
                                HiveAccountState    = "Подключение к Hive установлено";
                                HiveConnectionState = "Подключение к Hive установлено";

                                HiveWorkers = HiveClient.GetWorkers();

                                if (HiveWorkers != null)
                                {
                                    List <string> LST = (from w in HiveWorkers select w.name).ToList();
                                    LST.Insert(0, "---");
                                    HiveWorkersNames = LST;
                                }
                            }
                            else
                            {
                                HiveAccountState = st.Message;
                            }
                        }
                        else
                        {
                            HiveAccountState    = "Подключение к Hive отсутствует";
                            HiveConnectionState = "Подключение к Hive отсутствует";
                        }
                    });

                VKuserID = GenSettings.VKuserID;
            } break;
            }
        }