Example #1
0
        private void btnLeaveSubstractChanges_Click(object sender, EventArgs e)
        {
            BlastLayer changes  = (BlastLayer)S.GET <RTC_NewBlastEditor_Form>().currentSK.BlastLayer.Clone();
            BlastLayer modified = (BlastLayer)originalBlastLayer.Clone();

            foreach (var unit in changes.Layer)
            {
                var TargetUnit = modified.Layer.FirstOrDefault(it =>
                                                               it.Address == unit.Address &&
                                                               it.Domain == unit.Domain &&
                                                               it.ExecuteFrame == unit.ExecuteFrame &&
                                                               it.GeneratedUsingValueList == unit.GeneratedUsingValueList &&
                                                               it.InvertLimiter == unit.InvertLimiter &&
                                                               it.SourceAddress == unit.SourceAddress &&
                                                               it.SourceDomain == unit.SourceDomain &&
                                                               it.StoreLimiterSource == unit.StoreLimiterSource &&
                                                               it.StoreTime == unit.StoreTime &&
                                                               it.StoreType == unit.StoreType &&
                                                               it.TiltValue == unit.TiltValue &&
                                                               it.ValueString == unit.ValueString
                                                               );

                if (TargetUnit != null && !TargetUnit.IsLocked)
                {
                    modified.Layer.Remove(TargetUnit);
                }
            }

            S.GET <RTC_NewBlastEditor_Form>().LoadBlastlayer(modified);

            this.Close();
        }
Example #2
0
        public static void OpenAnalyticsTool(BlastLayer bl = null)
        {
            S.GET <RTC_AnalyticsTool_Form>().Close();
            var stf = new RTC_AnalyticsTool_Form();

            S.SET(stf);

            if (bl == null)
            {
                return;
            }

            if (bl.Layer.Count == 0)
            {
                MessageBox.Show("Sanitize Tool cannot sanitize BlastLayers that don't have any units.");
                return;
            }

            if (bl.Layer.Count == 1)
            {
                MessageBox.Show("Sanitize Tool cannot sanitize BlastLayers that only have one unit.");
                return;
            }

            BlastLayer clone = (BlastLayer)bl.Clone();

            stf.lbDumps.DisplayMember = "Text";
            stf.lbDumps.ValueMember   = "Value";
            stf.lbDumps.Items.Add(new { Text = $"Original Layer [{clone.Layer.Count} Units]", Value = clone });

            stf.originalBlastLayer = clone;

            stf.ShowDialog();
        }
Example #3
0
        public static void OpenSanitizeTool(BlastLayer bl = null)
        {
            S.GET <RTC_SanitizeTool_Form>().Close();
            var stf = new RTC_SanitizeTool_Form();

            S.SET(stf);

            if (bl == null)
            {
                return;
            }

            if (!bl.Layer.Any(x => !x.IsLocked))
            {
                MessageBox.Show("Sanitize Tool cannot sanitize BlastLayers that don't have any units.");
                return;
            }

            if (bl.Layer.Count(x => !x.IsLocked) == 1)
            {
                MessageBox.Show("Sanitize Tool cannot sanitize BlastLayers that only have one unit.");
                return;
            }

            BlastLayer clone = (BlastLayer)bl.Clone();

            stf.lbOriginalLayerSize.Text = $"Original Layer size: {clone.Layer.Count(x => !x.IsLocked)}";


            stf.lbSteps.DisplayMember = "Text";
            stf.lbSteps.ValueMember   = "Value";
            stf.lbSteps.Items.Add(new { Text = $"Original Layer [{clone.Layer.Count(x => !x.IsLocked)} Units]", Value = clone });

            stf.originalBlastLayer = clone;
            stf.workBlastLayer     = bl;

            stf.UpdateSanitizeProgress();
            stf.ShowDialog();
        }