Пример #1
0
 private void ContactLeftPlus_Click(object sender, EventArgs e)
 {
     connectSource = true;
     Design.Animate(plugLeftPlusUD, GlobalData.TimePlugAnimation);
     GlobalData.deviceSource = this;
     // подключение левого плюсового контакта
     contactsDoubleSwitch[0, 0] = true;
     contactsDoubleSwitch[0, 1] = false;
     contactsDoubleSwitch[1, 0] = false;
     contactsDoubleSwitch[1, 1] = false;
     contactsDoubleSwitch[2, 0] = false;
     contactsDoubleSwitch[2, 1] = false;
 }
Пример #2
0
 private void ContactLeftMinus_Click(object sender, EventArgs e)
 {
     if (GlobalData.deviceSource != this)
     {
         connectReceiver = true;
         Design.Animate(plugLeftMinusUD, GlobalData.TimePlugAnimation);
         Design.ConnectionElements(GlobalData.deviceSource, this);
     }
     else
     {
         MessageBox.Show("Подключение невозможно...");
     }
 }
Пример #3
0
 private void ContactLeft_Click(object sender, EventArgs e)
 {
     if (GlobalData.deviceSource != this)
     {
         connectReceiver = true;
         Design.Animate(plugMinusLR, GlobalData.TimePlugAnimation);
         Design.ConnectionElements(GlobalData.deviceSource, this);
         //MessageBox.Show(Convert.ToString(GetPointLeft()));
         //MessageBox.Show(Convert.ToString(GlobalData.deviceSource.GetType()) + "" + Convert.ToString(this.GetType()));
         //MessageBox.Show(Convert.ToString(contactsSingleSwitch[0]) + " " + Convert.ToString(contactsSingleSwitch[1]) + " " + Convert.ToString(contactsSingleSwitch[2]));
     }
     else
     {
         MessageBox.Show("Подключение невозможно...");
     }
 }
Пример #4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            this.BackColor = Color.FromArgb(237, 249, 255);

            Elements.Type[] types = new Elements.Type[13] {
                Elements.Type.Ammeter,
                Elements.Type.Voltmeter,
                Elements.Type.Multimeter,
                Elements.Type.Resistor,
                Elements.Type.Conductor,
                Elements.Type.Rheostat,
                Elements.Type.VoltageSource,
                Elements.Type.Capacitor,
                Elements.Type.SingleSwitch,
                Elements.Type.DoubleSwitch,
                Elements.Type.Toggle,
                Elements.Type.Lamp,
                Elements.Type.Stopwatch
            };

            Design.CreatePanel(pictureBox3, types);
        }
Пример #5
0
 private void MainForm_Click(object sender, EventArgs e)
 {
     if (zeroitMetroSwitch1.Checked == true)
     {
         if (Design.GetType() == Elements.Type.Ammeter)
         {
             Elements.ammeter = new Ammeter();
             Elements.ammeter.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.ammeter, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Voltmeter)
         {
             Elements.voltmeter = new Voltmeter();
             Elements.voltmeter.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.voltmeter, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Multimeter)
         {
             Elements.multimeter = new Multimeter();
             Elements.multimeter.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.multimeter, ReportManager.TypeAction.Add);
             //Elements.multimeter.SetValue(Elements.capacitor.GetValue());
         }
         else if (Design.GetType() == Elements.Type.Resistor)
         {
             Elements.resistor[0] = new Resistor();
             Elements.resistor[0].Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.resistor[0], ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Rheostat)
         {
             Elements.rheostat = new Rheostat();
             Elements.rheostat.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.rheostat, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.VoltageSource)
         {
             Elements.voltageSource = new VoltageSource();
             Elements.voltageSource.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.voltageSource, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Capacitor)
         {
             Elements.capacitor = new Capacitor();
             Elements.capacitor.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.capacitor, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.SingleSwitch)
         {
             Elements.singleSwitch = new SingleSwitch();
             Elements.singleSwitch.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.singleSwitch, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.DoubleSwitch)
         {
             Elements.doubleSwitch = new DoubleSwitch();
             Elements.doubleSwitch.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.doubleSwitch, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Toggle)
         {
             Elements.toggle = new Toggle();
             Elements.toggle.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.toggle, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Lamp)
         {
             Elements.lamp = new Lamp();
             Elements.lamp.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.lamp, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Stopwatch)
         {
             Elements.stopwatch = new Stopwatch();
             Elements.stopwatch.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.stopwatch, ReportManager.TypeAction.Add);
         }
         else if (Design.GetType() == Elements.Type.Conductor)
         {
             Elements.conductor = new Conductor();
             Elements.conductor.Visualization(this, GlobalData.X, GlobalData.Y);
             GlobalData.workWithElements.AddAction(Elements.conductor, ReportManager.TypeAction.Add);
         }
     }
 }
Пример #6
0
 private void button24_Click(object sender, EventArgs e)
 {
     Design.ShowPicture();
 }
Пример #7
0
        //Graphics graphics;
        //SolidBrush brush = new SolidBrush(Color.FromArgb(65, 65, 65));

        private void MainForm_MouseClick(object sender, MouseEventArgs e)
        {
            Design.HidePicture();
            //graphics = CreateGraphics();
            //graphics.FillRectangle(brush, e.X - 15, e.Y - 5, 30, 10);
        }
Пример #8
0
 private void button22_Click(object sender, EventArgs e)
 {
     Design.Animate(pictureBox2, GlobalData.TimePlugAnimation);
 }
Пример #9
0
 private void ContactPlus_Click(object sender, EventArgs e)
 {
     connectSource           = true;
     GlobalData.deviceSource = this;
     Design.Animate(plugPlusDU, GlobalData.TimePlugAnimation);
 }