예제 #1
0
        /// <summary> Edit multiple signals
        /// </summary>
        private void editSignals()
        {
            //start dialog
            signalWindow signalDialog = new signalWindow(true);
            signalDialog.ShowDialog();

            if (signalDialog.resultSignal != null) //something was changed
            {
                foreach (Signal sig in listBoxSignals.SelectedItems)
                {
                    //update only if not *
                    if (signalDialog.resultSignal.title.Text != "*")
                        sig.title.Text = signalDialog.resultSignal.title.Text;
                    if (signalDialog.resultSignal.chartArea.AxisX.Title != "*")
                        sig.chartArea.AxisX.Title = signalDialog.resultSignal.chartArea.AxisX.Title;
                    if (signalDialog.resultSignal.chartArea.AxisY.Title != "*")
                        sig.chartArea.AxisY.Title = signalDialog.resultSignal.chartArea.AxisY.Title;
                    if (signalDialog.resultSignal.lineColor != "")
                        sig.lineColor = signalDialog.resultSignal.lineColor;
                }
                //refresh items
                listBoxSignals.Items.Refresh();
            }
        }
예제 #2
0
 /// <summary> Add Signal
 /// </summary>
 private Signal querySignal()
 {
     signalWindow signalDialog = new signalWindow(false);
     signalDialog.ShowDialog();
     return signalDialog.resultSignal;
 }
예제 #3
0
        /// <summary> Edit signal button
        /// </summary>
        private Signal editSignal(Signal sig)
        {
            //start dialog
            signalWindow signalDialog = new signalWindow(sig);
            signalDialog.ShowDialog();

            if (signalDialog.resultSignal != null) //something was changed
            {
                //copy titles from "created" signal
                sig.title.Text = signalDialog.resultSignal.title.Text;
                sig.chartArea.AxisX.Title = signalDialog.resultSignal.chartArea.AxisX.Title;
                sig.chartArea.AxisY.Title = signalDialog.resultSignal.chartArea.AxisY.Title;

                //series
                sig.lineColor = signalDialog.resultSignal.lineColor;

                //update regexps should be ok because they are checked while creating new signal
                sig.updateRegExpMatch(signalDialog.resultSignal.regExpMatchString);
                sig.updateRegExpParse(signalDialog.resultSignal.regExpParseString);
            }
            return sig;
        }