Beispiel #1
0
        // Constructor(s)
        public Shield(Vector2 position, int width, int height, float shieldValue, int method, int itemLevel)
            : base(Item.Nothing, ItemType.shield, TextureManager.shields[Globals.Randomizer.Next(0, TextureManager.shields.Count)], "", "Shield")
        {
            this.Type = ItemType.shield;
            if (itemLevel != -1)
            {
                this.ShieldHeal = Globals.Randomizer.Next(10 + itemLevel * 3, 15 + itemLevel * 3);
                this.Chance     = Globals.Randomizer.Next(13 + itemLevel * 5, 24 + itemLevel * 6);
            }
            else
            {
                this.ShieldHeal = 13;
                this.Chance     = 15;
            }
            this.ItemLevel = itemLevel;

            this.ShieldBar = new Bar(position, width, height, shieldValue, Color.LightBlue);

            this.Method = ListOfShieldMethods()[method];

            this.Descriptions = new List <string>();
            Descriptions.Add("A standard shield.");
            Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to reflect a shot.");
            Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to fire you current weapon when you are hit.");
            Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to loose energy instead of Shield/HP when you are hit.");
            Descriptions.Add("When you are hit, the damage is split up in five and taken over time.");
            Descriptions.Add("Has a |255,0,255|" + Chance + "|W|% chance to teleport to another location just before being hit.");
            Descriptions.Add("Increase damage by 1-3 every time you get hit for the remainder of the fight.");
            Descriptions.Add("50 % chance to reduce damage by 50 %.");

            this.Description = "|W|Shield: |0,0,255|" + MaxValue + "|W|\n" + "Shield heal on Match: |0,150,255|" + ShieldHeal + "|W|\n" + Descriptions[method];
        }
Beispiel #2
0
 /// <summary>
 /// Adds the localized description of the argument
 /// </summary>
 /// <param name="localeField">The locale field.</param>
 /// <param name="valueField">The value field.</param>
 internal void AddDescription(string localeField, string valueField)
 {
     Descriptions.Add(new Description()
     {
         Locale = localeField, Text = valueField
     });
 }
Beispiel #3
0
        public static ITask CreateForFrequency(MainModel radio, double frequency)
        {
            //InitializeTuningControls(radio);
            Conditions conditions = new Conditions();

            conditions
            .Add(() => radio.WorkMode.Value == WorkModeState.Simplex)                             // simplex
            .Add(() => radio.Noise.Value == 1.0)                                                  // noise
            .Add(() => radio.Voltage.Value == 0)                                                  // voltage
            .Add(() => radio.Scale.Value == Turned.On)                                            //scale
            .Add(() => radio.Power.Value == Turned.On)                                            // power
            .Add(() => radio.Volume.Value == 1.0)                                                 // volume
            .Add(() => radio.Antenna.Value > 0.8 && radio.AntennaFixer.Value == ClampState.Fixed) // antenna
            .Add(() => radio.Frequency.Value.CompareInRange(frequency, DoubleExtentions.AcceptableRangeForFrequency));


            Descriptions desctiptions = new Descriptions();

            desctiptions
            .Add("Не установлен \"СИМПЛЕКС\".")
            .Add("Не установлена Ручка \"ШУМЫ\" влево до упора.")
            .Add("Не установлен Переключатель контроля напряжений в положении \"РАБОТА 1\".")
            .Add("Не установлены Тумблер \"ШКАЛА\" в положение \"ВКЛ\".")
            .Add("Не установлены Тумблер \"ПИТАНИЕ\" в положение \"ВКЛ\".")
            .Add("Не установлен Регулятор \"ГРОМКОСТЬ\" вправо до упора.")
            .Add("Не настроена антенна.")
            .Add("Не установлена частота.");

            return(new TaskModelNotSequance(conditions, desctiptions, () => InitializeTuningControls(radio)));
        }
Beispiel #4
0
        /// <summary>
        /// Adds an entry in the control-setting map and also generates a tooltip for the setting.
        /// </summary>
        /// <param name="sectionName">
        /// The name of the section.
        /// </param>
        /// <param name="setting">
        /// The name of the setting.
        /// </param>
        /// <param name="control">
        /// The control used to edit the setting.
        /// </param>
        /// <param name="settingsMap">
        /// The settings map to add the entry in.
        /// </param>
        static public void AddMap <T>(string sectionName, Expression <Func <T> > setting, Control control, Dictionary <string, Control> settingsMap)
        {
            // Validate
            if (settingsMap == null)
            {
                throw new ArgumentNullException("settingsMap");
            }

            // Get the member expression
            var me = (MemberExpression)setting.Body;

            // Get the property
            var prop = (PropertyInfo)me.Member;

            // Get the setting name by reading the property
            var settingName = (string)prop.GetValue(null, null);

            // Get the description attribute
            var descAttr = GetCustomAttribute <DescriptionAttribute>(prop);
            var desc     = (descAttr != null ? descAttr.Description : string.Empty);

            // Set the tooltip
            // MainForm.Current.ToolTip.SetToolTip(control, desc);

            // Alternative (a little bit less obstructive) way to display help inside yellow header.
            // We could add settings EnableHelpTooltips=1, EnableHelpHeader=1
            control.MouseHover += control_MouseEnter;
            control.MouseLeave += control_MouseLeave;
            Descriptions.Add(control, desc);

            // Add to the map
            settingsMap.Add(sectionName + settingName, control);
        }
Beispiel #5
0
 public void AddDefendEffect(string description, Action <Attack> effect)
 {
     if (description != null)
     {
         Descriptions.Add(description);
     }
     DefendEffects.Add(effect);
 }
Beispiel #6
0
 public void AddTurnEffect(string description, Action eachTurn)
 {
     if (description != null)
     {
         Descriptions.Add(description);
     }
     EachTurnEffects.Add(eachTurn);
 }
Beispiel #7
0
 public void AddEffect(string description, Action begin, Action end)
 {
     if (description != null)
     {
         Descriptions.Add(description);
     }
     BeginEffects.Add(begin);
     EndEffects.Add(end);
 }
Beispiel #8
0
        public ClientControlMenu(GameClient client)
        {
            Descriptions.Add(ClientControl.ListLobbies, "List lobbies");
            Descriptions.Add(ClientControl.CreateLobby, "Create lobby");
            Descriptions.Add(ClientControl.JoinLobby, "Join lobby");
            Descriptions.Add(ClientControl.LeaveServer, "Leave server");

            On(ClientControl.CreateLobby, client.InitCreateLobby);
        }
Beispiel #9
0
 /// <summary> Add a new description to be included within the Identify response of the OAI-PMH protocol </summary>
 /// <param name="NewDescription"> New custom description to be included </param>
 public void Add_Description(string NewDescription)
 {
     if (Descriptions == null)
     {
         Descriptions = new List <string>();
     }
     if (!(Descriptions.Exists(s => s.IndexOf(NewDescription, StringComparison.OrdinalIgnoreCase) >= 0)))
     {
         Descriptions.Add(NewDescription);
     }
 }
Beispiel #10
0
 public void AddName(string name, string description)
 {
     if (!Names.Contains(name))
     {
         Names.Add(name);
     }
     if (!Descriptions.Contains(description))
     {
         Descriptions.Add(description);
     }
 }
Beispiel #11
0
        public InitGameMenu(Game game)
        {
            _game = game;

            Descriptions.Add(InitGame.StartServer, "Start server");
            Descriptions.Add(InitGame.ConnectToServer, "Connect to server");
            Descriptions.Add(InitGame.QuitGame, "Quit game");

            On(InitGame.StartServer, game.CreateServer);
            On(InitGame.ConnectToServer, game.CreateClient);
            On(InitGame.QuitGame, () => {});
        }
        private static void RegisterTacticDatas()
        {
            Type targetSelectionTacticDataType = typeof(TargetSelectionTactic);
            IEnumerable <Type> tacticDataTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => !t.IsAbstract && t.IsSubclassOf(targetSelectionTacticDataType));

            foreach (var type in tacticDataTypes)
            {
                TargetSelectionTactic tactic = (TargetSelectionTactic)Activator.CreateInstance(type);

                int count = TacticDatas.Count;

                string name = tactic.Name;
                if (NameToID.ContainsKey(name))
                {
                    throw new Exception($"A {nameof(TargetSelectionTactic)} of name '{name}' has already been added!");
                }

                if (count >= DefaultTacticID)
                {
                    throw new Exception($"Data limit of {DefaultTacticID} reached!");
                }

                TacticDatas.Add(tactic);
                DisplayNames.Add(tactic.DisplayName);
                Descriptions.Add(tactic.Description);
                string texture = tactic.Texture;
                Textures.Add(ModContent.GetTexture(texture));
                OutlineTextures.Add(ModContent.GetTexture(texture + "_Outline"));
                SmallTextures.Add(ModContent.GetTexture(texture + "_Small"));

                byte id = (byte)count;
                Count++;
                TypeToID[type] = id;
                NameToID[name] = id;
                tactic.ID      = id;
            }

            OrderedIds = new List <byte>
            {
                //First row
                GetTactic <ClosestEnemyToMinion>().ID,
                GetTactic <StrongestEnemy>().ID,
                GetTactic <LeastDamagedEnemy>().ID,
                GetTactic <SpreadOut>().ID,

                //Second row
                GetTactic <ClosestEnemyToPlayer>().ID,
                GetTactic <WeakestEnemy>().ID,
                GetTactic <MostDamagedEnemy>().ID,
                GetTactic <AttackGroups>().ID,
            };
        }
Beispiel #13
0
        public static ITask CreateForCheckStation(MainModel radio)
        {
            //InitializeWorkingControls(radio);
            Conditions conditions = new Conditions();

            conditions
            .Add(() => radio.WorkMode.Value == WorkModeState.Simplex)
            .Add(() => radio.Noise.Value == 1.0)
            .Add(() => radio.Scale.Value == Turned.On && radio.Power.Value == Turned.On)
            .Add(() => radio.Tangent.Value == Turned.On)
            .Add(() => radio.Volume.Value == 1.0)
            .Add(() => radio.Range.Value == RangeState.SmoothRange1)
            .Add(() => { return(radio.Frequency.Value > 21); })
            .Add(() => radio.Noise.Value < 0.5)
            .Add(() => radio.WorkMode.Value == WorkModeState.StandbyReception)
            .Add(() => radio.Tone.Value == Turned.On)
            .Add(() => radio.WorkMode.Value == WorkModeState.Simplex)
            .Add(() => radio.Tangent.Value == Turned.On)
            .Add(() => radio.Antenna.Value > 0.8)
            .Add(() => radio.Tone.Value == Turned.On)
            .Add(() => radio.Clamps[0].Value == ClampState.Fixed &&
                 radio.Clamps[1].Value == ClampState.Fixed &&
                 radio.Clamps[2].Value == ClampState.Fixed &&
                 radio.Clamps[3].Value == ClampState.Fixed)
            .Add(() => radio.Antenna.Value > 0.8)
            .Add(() => radio.Range.Value == RangeState.FixedFrequency4)
            .Add(() => radio.Power.Value == Turned.Off);

            Descriptions desctiptions = new Descriptions();

            desctiptions
            .Add("Не установлен \"СИМПЛЕКС\".")
            .Add("Не установлена Ручка \"ШУМЫ\" влево до упора.")
            .Add("Не установлены Тумблеры \"ПИТАНИЕ\", \"ШКАЛА\" в положение \"ВКЛ\".")
            .Add("Не проверено напряжение питания.")
            .Add("Не установлен Регулятор \"ГРОМКОСТЬ\" вправо до упора.")
            .Add("Не установлен \"ПЛАВНЫЙ ПОДДИАПАЗОН\".")
            .Add("Не прослушана работа по диапазону.")
            .Add("Не проверена работа подавителя шумов.")
            .Add("Не установлен \"ДЕЖ. ПРИЕМ\".")
            .Add("Не нажата \"ТОН-ВЫЗОВ\" и не проверена калибровка.")
            .Add("Не установлен \"СИМПЛЕКС\".")
            .Add("Не нажата тангента в \"ПРД\".")
            .Add("Не настроена антенная цепь.")
            .Add("Не установлен проверена работа Тон-Вызова.")
            .Add("Не зафиксированны фиксаторы 1, 2, 3 и 4.")
            .Add("Антенна не настроена на максимум.")
            .Add("Не проверена автоматика в положении 1, 2, 3 и 4.")
            .Add("Не выключено питание.");

            return(new TaskModel(conditions, desctiptions, new WorkingSubscribesInitializer(radio), () => InitializeWorkingControls(radio)));
        }
Beispiel #14
0
        private void WizardForm_Load(object sender, EventArgs e)
        {
            // set up descriptions and title
            Descriptions.Add("Data Source Configuration,This wizard will create a full Windows Forms project connected to an existing MySQL database using Entity Framework or ADO.NET Typed Datasets.");
            Descriptions.Add("Database objects selection,Please select the tables that you want to include in the generation of your model");
            WizardName = "Windows Forms Project";

            // Create linked list of wizard pages.
            Pages.Add(dataAccessConfig1);
            Pages.Add(tablesSelection1);

            CurPage = dataAccessConfig1;
            Current = 0;
            BaseWizardForm_Load(sender, e);
        }
Beispiel #15
0
        //Parse
        private void ParseRSS()
        {
            try
            {
                XmlDocument rssXmlDoc = new XmlDocument();
                // Load the RSS file from the RSS URL
                rssXmlDoc.Load(URL);
                //Store initial values - title and link
                XmlNode TL = rssXmlDoc.SelectSingleNode("rss/channel");
                this.Title         = TL.SelectSingleNode("title").InnerText.Trim();
                this.Link          = TL.SelectSingleNode("link").InnerText.Trim();
                this.Description   = TL.SelectSingleNode("description").InnerText.Trim();
                this.Language      = TL.SelectSingleNode("language").InnerText.Trim();
                this.LastBuildDate = TL.SelectSingleNode("lastBuildDate").InnerText.Trim();

                // Parse the Items in the RSS file
                XmlNodeList rssNodes = rssXmlDoc.SelectNodes("rss/channel/item");
                foreach (XmlNode rssNode in rssNodes)
                {
                    //Title
                    XmlNode rssSubNode = rssNode.SelectSingleNode("title");
                    string  title      = rssSubNode != null ? rssSubNode.InnerText : "";

                    //Link/Url
                    rssSubNode = rssNode.SelectSingleNode("link");
                    string link = rssSubNode != null ? rssSubNode.InnerText : "";
                    link = ParseLink(link);

                    //Description
                    rssSubNode = rssNode.SelectSingleNode("description");
                    string description = rssSubNode != null ? rssSubNode.InnerText : "";

                    //Published date
                    rssSubNode = rssNode.SelectSingleNode("pubDate");
                    string pubDate = rssSubNode != null ? rssSubNode.InnerText : "";

                    Titles.Add(title);
                    URLs.Add(link);
                    Descriptions.Add(description);
                    PublishedDates.Add(pubDate);
                    TitlesURLs.Add(title + " - " + link);

                    Items.Add(new Item(title, link, description, pubDate));
                }
            }
            catch (Exception e) { throw e; }
        }
Beispiel #16
0
 static public void AddMap(string sectionName, string settingName, Control control, Dictionary <string, Control> settingsMap)
 {
     // Validate
     if (settingsMap == null)
     {
         throw new ArgumentNullException("settingsMap");
     }
     // Set the tool-tip
     // MainForm.Current.ToolTip.SetToolTip(control, desc);
     // Alternative (a little bit less obstructive) way to display help inside yellow header.
     // We could add settings EnableHelpTooltips=1, EnableHelpHeader=1
     control.MouseHover += control_MouseEnter;
     control.MouseLeave += control_MouseLeave;
     Descriptions.Add(control, settingName);
     // Add to the map
     settingsMap.Add(sectionName + settingName, control);
 }
        private void AdvancedWizardForm_Load(object sender, EventArgs e)
        {
            Descriptions.Add("View type Selection,Select the type of view to use in the form generation.");
            Descriptions.Add("Columns Validation,This page allows you to customize input validations for each column in the selected table.");
            Descriptions.Add("Detail Columns Validation,Within this step validations can be added on the columns for the child related table.");
            WizardName = "Windows Forms Project";

            Pages = new List <WizardPage>();

            Pages.Add(dataAccessTechnologyConfig1);
            Pages.Add(validationConfig1);
            Pages.Add(detailValidationConfig1);

            CurPage = dataAccessTechnologyConfig1;
            Current = 0;
            BaseWizardForm_Load(sender, e);
            ShowFinishButton(true);
        }
Beispiel #18
0
        public bool Parse(XmlNode node)
        {
            bool result = true;
            var  idAtt  = node.Attributes["uniqueID"];

            if (idAtt != null)
            {
                UniqueId = idAtt.InnerXml;

                foreach (XmlNode childNode in node)
                {
                    if (childNode.Name == "label")
                    {
                        var label = new XddLabel(childNode);

                        if (!label.Parse())
                        {
                            result = false;
                            break;
                        }

                        Labels.Add(label);
                    }
                    else if (childNode.Name == "description")
                    {
                        var description = new XddDescription(childNode);

                        if (!description.Parse())
                        {
                            result = false;
                            break;
                        }

                        Descriptions.Add(description);
                    }
                    else if (childNode.Name == "role")
                    {
                        Role = childNode.InnerXml.Trim();
                    }
                }
            }

            return(result);
        }
Beispiel #19
0
        private void WebWizardForm_Load(object sender, EventArgs e)
        {
            // set up descriptions and title
            Descriptions.Add("Data Source Configuration,This wizard will create a full MVC project connected to a MySQL database existing or will create a new one with a web site that includes user authentication with the ASP.NET MySQL Membership provider.");
            Descriptions.Add("Provider Settings Configuration,Please select the correspondant settings that will be applied for the ASP.NET MySQL Membership provider.");
            Descriptions.Add("Model Connection String Settings,Please select the correspondant settings to use in the Connection String for your Data Entity Model.");
            Descriptions.Add("Database objects selection,Please select the tables that you want to include in the generation of your model");
            WizardName = "ASP.net MVC Project";


            // Create linked list of wizard pages.
            Pages.Add(dataSourceConfiguration1);
            Pages.Add(providerConfiguration1);
            Pages.Add(modelConfiguration1);
            Pages.Add(tablesSelection1);
            CurPage = dataSourceConfiguration1;
            Current = 0;
            BaseWizardForm_Load(sender, e);
        }
Beispiel #20
0
        public void setDefaults(string EventNamespace)
        {
            if (string.IsNullOrEmpty(EventNamespace))
            {
                EventNamespace = "namespace";
            }
            id             = EventNamespace + ".0";
            picture        = "event_test";
            type           = EventType.country_event;
            internalScript = new Script();
            EventDescriptionModel newDesc = new EventDescriptionModel();

            newDesc.setDefaults();
            Descriptions.Add(newDesc);
            EventOptionModel newOptions = new EventOptionModel();

            newOptions.setDefaults();
            Options.Add(newOptions);
        }
Beispiel #21
0
        // Constructor(s)
        public Hull(Ship ship, int method, int itemLevel)
            : base(Item.Nothing, ItemType.hull, TextureManager.hulls[Globals.Randomizer.Next(0, TextureManager.hulls.Count)], "", "Hull")
        {
            this.Type      = ItemType.hull;
            this.ItemLevel = itemLevel;

            // Method variables
            RockResistance  = 1;
            this.TileChance = new List <TileType>();
            for (int i = 0; i < Enum.GetNames(typeof(TileType)).Length; i++)
            {
                for (int j = 0; j < 20; j++)
                {
                    TileChance.Add((TileType)i);
                }
            }

            if (itemLevel != -1)
            {
                this.Armor = Globals.Randomizer.Next(5 + itemLevel * 3, 10 + itemLevel * 4);
            }
            else
            {
                this.Armor = 7;
            }

            this.Method = ListOfHullMethods()[method];
            Method(ship, this);

            this.Descriptions = new List <string>();

            Descriptions.Add("A standard hull.");
            Descriptions.Add("Rocks deals half damage.");
            Descriptions.Add("Increase |255, 70, 0|weapon chance|W| by " + WeaponChance + "%");
            Descriptions.Add("Increase the chance of cog tiles appearing by 100%");
            Descriptions.Add("Increase the chance of shield tiles appearing by 100%");
            Descriptions.Add("Increase the chance of weapon tiles appearing by 75%");
            Descriptions.Add("Flash a random possible tilematch when there has been no match for a few seconds.");
            Descriptions.Add("Increases the accuracy of some weapons.");

            this.Description = "|W|Armor: |255,255,0|" + Armor + "|W|\n" + Descriptions[method];
        }
Beispiel #22
0
        public static void LoadLanguageFile()
        {
            Descriptions.Clear();
            var resource = $"AssetViewer.Resources.Assets.Texts_{Language.ToString("G")}.xml";

            if (!Assembly.GetExecutingAssembly().GetManifestResourceNames().Contains(resource))
            {
                Language = Data.Languages.English;
                resource = $"AssetViewer.Resources.Assets.Texts_{Language.ToString("G")}.xml";
            }

            using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resource))
                using (var reader = new StreamReader(stream)) {
                    var document = XDocument.Parse(reader.ReadToEnd()).Root;
                    foreach (var item in document.Elements())
                    {
                        Descriptions.Add(int.Parse(item.Attribute("ID").Value), item.Value);
                    }
                }
        }
Beispiel #23
0
        void IGXDLMSBase.SetValue(GXDLMSSettings settings, ValueEventArgs e)
        {
            switch (e.Index)
            {
            case 1:
                LogicalName = GXCommon.ToLogicalName(e.Value);
                break;

            case 2:
                Token = (byte[])e.Value;
                break;

            case 3:
                Time = (GXDateTime)GXDLMSClient.ChangeType((byte[])e.Value, DataType.DateTime, settings.UseUtc2NormalTime);
                break;

            case 4:
                Descriptions.Clear();
                if (e.Value != null)
                {
                    foreach (object it in (object[])e.Value)
                    {
                        Descriptions.Add(ASCIIEncoding.ASCII.GetString((byte[])it));
                    }
                }
                break;

            case 5:
                DeliveryMethod = (TokenDelivery)e.Value;
                break;

            case 6:
                StatusCode = (TokenStatusCode)((object[])e.Value)[0];
                DataValue  = Convert.ToString(((object[])e.Value)[1]);
                break;

            default:
                e.Error = ErrorCode.ReadWriteDenied;
                break;
            }
        }
Beispiel #24
0
        public AssemblyList(string directory, bool recurse)
        {
            IsWindows = STEM.Sys.Control.IsWindows;
            IsX64     = STEM.Sys.Control.IsX64;

            base.Path = directory;

            directory = System.IO.Path.GetFullPath(directory);

            foreach (string s in STEM.Sys.IO.Directory.STEM_GetFiles(directory, "*.dll|*.so|*.a|*.lib", "!.Archive|!TEMP", recurse ? System.IO.SearchOption.AllDirectories : System.IO.SearchOption.TopDirectoryOnly, false))
            {
                if (!Descriptions.Exists(i => i.Filename == s.Substring(directory.Length).Trim(System.IO.Path.DirectorySeparatorChar)))
                {
                    try
                    {
                        Descriptions.Add(new Sys.IO.FileDescription(directory, s.Substring(directory.Length).Trim(System.IO.Path.DirectorySeparatorChar), false));
                    }
                    catch { }
                }
            }
        }
Beispiel #25
0
        public static ITask CreateForPrepareState(MainModel radio)
        {
            //InitializeTuningControls(radio);
            Conditions conditions = new Conditions();

            conditions
            .Add(() => radio.WorkMode.Value == WorkModeState.Simplex)                             // simplex
            .Add(() => radio.Noise.Value == 1.0)                                                  // noise
            .Add(() => radio.Voltage.Value == 0)                                                  // voltage
            .Add(() => radio.Scale.Value == Turned.On)                                            //scale
            .Add(() => radio.Power.Value == Turned.On)                                            // power
            .Add(() => radio.Volume.Value == 1.0)                                                 // volume
            .Add(() => radio.Range.Value == RangeState.FixedFrequency1)                           // range
            .Add(() => radio.Clamps[0].Value == ClampState.Unfixed)                               // clamps on
            .Add(() => radio.Clamps[0].Value == ClampState.Fixed)                                 // clamps off
            .Add(() => radio.SubFixFrequency[0].Value == Turned.On)                               // subfixfrequency
            .Add(() => radio.Tangent.Value == Turned.On)                                          // prd
            .Add(() => radio.Antenna.Value > 0.8 && radio.AntennaFixer.Value == ClampState.Fixed) // antenna
            .Add(() => radio.Tangent.Value == Turned.Off);                                        // tangent off


            Descriptions desctiptions = new Descriptions();

            desctiptions
            .Add("Не установлен \"СИМПЛЕКС\".")
            .Add("Не установлена Ручка \"ШУМЫ\" влево до упора.")
            .Add("Не установлен Переключатель контроля напряжений в положении \"РАБОТА 1\".")
            .Add("Не установлены Тумблер \"ШКАЛА\" в положение \"ВКЛ\".")
            .Add("Не установлены Тумблер \"ПИТАНИЕ\" в положение \"ВКЛ\".")
            .Add("Не установлен Регулятор \"ГРОМКОСТЬ\" вправо до упора.")
            .Add("Не установлен переключатель \"ФИКСИРОВАННЫЕ ЧАСТОТЫ-ПЛАВНЫЙ ПОДДИАПАЗОН\" в положение 1.")
            .Add("Не расфиксирован фиксатор-1.")
            .Add("Не зафиксирован фиксатор-1.")
            .Add("Не установлен поддиапазон 1.")
            .Add("Не установлен ПРД.")
            .Add("Не настроена антенна.")
            .Add("Не отпущена тангента.");

            return(new TaskModel(conditions, desctiptions, new TuningSubscribesInitializer(radio), () => InitializeTuningControls(radio)));
        }
Beispiel #26
0
        public static ITask CreateForInitialState(MainModel radio)
        {
            //InitializeControls(radio);
            Conditions conditions = new Conditions();

            conditions
            .Add(() => radio.WorkMode.Value == WorkModeState.Simplex)
            .Add(() => radio.Noise.Value == 1.0)
            .Add(() => radio.Voltage.Value == VoltageState.Broadcast1)
            .Add(() => radio.Scale.Value == Turned.Off)
            .Add(() => radio.Power.Value == Turned.Off)
            .Add(() => radio.Volume.Value == 1.0)
            .Add(() => radio.Range.Value >= 0 && (int)radio.Range.Value < 4)
            .Add(() => radio.Clamps[0].Value == ClampState.Fixed &&
                 radio.Clamps[1].Value == ClampState.Fixed &&
                 radio.Clamps[2].Value == ClampState.Fixed &&
                 radio.Clamps[3].Value == ClampState.Fixed)
            .Add(() => radio.SubFixFrequency[0].Value == Turned.Off &&
                 radio.SubFixFrequency[1].Value == Turned.Off &&
                 radio.SubFixFrequency[2].Value == Turned.Off &&
                 radio.SubFixFrequency[3].Value == Turned.Off)
            .Add(() => radio.AntennaFixer.Value == ClampState.Fixed);

            Descriptions desctiptions = new Descriptions();

            desctiptions
            .Add("Не установлен \"СИМПЛЕКС\".")
            .Add("Не установлена Ручка \"ШУМЫ\" влево до упора.")
            .Add("Не установлен Переключатель контроля напряжений в положении \"РАБОТА 1\".")
            .Add("Не установлены Тумблер \"ШКАЛА\" в положение \"ВКЛ\".")
            .Add("Не установлены Тумблер \"ПИТАНИЕ\" в положение \"ВКЛ\".")
            .Add("Не установлен Регулятор \"ГРОМКОСТЬ\" вправо до упора.")
            .Add("Переключатель \"ФИКСИР. ЧАСТОТЫ - ПЛАВНЫЙ ПОДДИАПАЗОН\" не в одном из положений \"ФИКСИР, ЧАСТОТЫ 1, 2, 3 или 4\".")
            .Add("Фиксаторы дисков установки частоты не затянуты.")
            .Add("Тумблеры \"ПОДДИАПАЗОН\" каждый не в положении \"ПОДДИАПАЗОН II\".")
            .Add("Фиксатор ручки \"НАСТРОЙКА АНТЕННЫ\" не затянут.");

            return(new TaskModelNotSequance(conditions, desctiptions, () => InitializeControls(radio)));
        }
Beispiel #27
0
        void IGXDLMSBase.Load(GXXmlReader reader)
        {
            Token = GXCommon.HexToBytes(reader.ReadElementContentAsString("Token"));
            string tmp = reader.ReadElementContentAsString("Time");

            if (tmp != null)
            {
                Time = new GXDateTime(tmp, System.Globalization.CultureInfo.InvariantCulture);
            }
            Descriptions.Clear();
            if (reader.IsStartElement("Descriptions", true))
            {
                while (reader.IsStartElement("Item", true))
                {
                    Descriptions.Add(reader.ReadElementContentAsString("Name"));
                }
                reader.ReadEndElement("Descriptions");
            }
            DeliveryMethod = (TokenDelivery)reader.ReadElementContentAsInt("DeliveryMethod");
            StatusCode     = (TokenStatusCode)reader.ReadElementContentAsInt("Status");
            DataValue      = reader.ReadElementContentAsString("Data");
        }
Beispiel #28
0
 public void AddDescription(string text)
 {
     Descriptions.Add(new Description(text));
 }
Beispiel #29
0
        static DataEnumsB()
        {
//			REV_SELECTED           .Name = nameof(REV_SELECTED);
//			REV_SEQ                .Name = nameof(REV_SEQ);
//			REV_KEY_ALTID          .Name = nameof(REV_KEY_ALTID);
//			REV_KEY_TYPE_CODE      .Name = nameof(REV_KEY_TYPE_CODE);
//			REV_KEY_DISCIPLINE_CODE.Name = nameof(REV_KEY_DISCIPLINE_CODE);
//			REV_KEY_DELTA_TITLE    .Name = nameof(REV_KEY_DELTA_TITLE);
//			REV_KEY_SHEETNUM       .Name = nameof(REV_KEY_SHEETNUM);
//			REV_ITEM_VISIBLE       .Name = nameof(REV_ITEM_VISIBLE);
//			REV_ITEM_REVID         .Name = nameof(REV_ITEM_REVID);
//			REV_ITEM_BLOCK_TITLE   .Name = nameof(REV_ITEM_BLOCK_TITLE);
//			REV_ITEM_DATE          .Name = nameof(REV_ITEM_DATE);
//			REV_ITEM_BASIS         .Name = nameof(REV_ITEM_BASIS);
//			REV_ITEM_DESC          .Name = nameof(REV_ITEM_DESC);
//			REV_TAG_ELEM_ID        .Name = nameof(REV_TAG_ELEM_ID);
//			REV_CLOUD_ELEM_ID      .Name = nameof(REV_CLOUD_ELEM_ID);
//			REV_MGMT_COLUMN        .Name = nameof(REV_MGMT_COLUMN);
//			REV_KEY                .Name = nameof(REV_KEY);


            foreach (PropertyInfo p in typeof(DataItems).GetProperties())
            {
                Root r = (Root)p.GetValue(null);

                r.Name = p.Name;

                RootList.Add(r);

                if (r is Mgmt)
                {
                    MgmtList.Add((Mgmt)r);
                }

                if (r is Desc)
                {
                    Descriptions.Add((Desc)r);
                }

                if (r is Item)
                {
                    Items.Add((Item)r);
                }

                if (r is Filter)
                {
                    Filters.Add((Filter)r);
                }

                if (r is Compare)
                {
                    Comparisons.Add((Compare)r);
                }
            }

            REV_SELECTED.Column            = 1;
            REV_SEQ.Column                 = 1;
            REV_KEY_ALTID.Column           = 1;
            REV_KEY_TYPE_CODE.Column       = 1;
            REV_KEY_DISCIPLINE_CODE.Column = 1;
            REV_KEY_DELTA_TITLE.Column     = 1;
            REV_KEY_SHEETNUM.Column        = 1;
            REV_ITEM_VISIBLE.Column        = 1;
            REV_ITEM_REVID.Column          = 1;
            REV_ITEM_BLOCK_TITLE.Column    = 1;
            REV_ITEM_DATE.Column           = 1;
            REV_ITEM_BASIS.Column          = 1;
            REV_ITEM_DESC.Column           = 1;
            REV_TAG_ELEM_ID.Column         = 1;
            REV_CLOUD_ELEM_ID.Column       = 1;
//			REV_MGMT_COLUMN
//			REV_KEY
        }
Beispiel #30
0
 public Spell AddDescription(String name, string text)
 {
     Descriptions.Add(new Description(name, text));
     return(this);
 }