private void btnValidate_Click(object sender, EventArgs e)
        {
            CustomSerial gcodeChan = ComChannelFactory.getGCodeSerial();

            if (gcodeChan.IsOpen)
            {
                gcodeChan.Close();
            }
            this.ConfigureSerialPort(gcodeChan);
        }
        private void ConfigureSerialPort(CustomSerial gcodeChan)
        {
            string portName   = cmbPortName.SelectedItem.ToString();
            string baudRate   = txtBaudeRate.Text;
            string dataBits   = txtDataBits.Text;
            string stopBits   = cmbStop.SelectedItem.ToString();
            string parityBits = cmbParity.SelectedItem.ToString();

            gcodeChan.configure(portName, baudRate, dataBits, stopBits, parityBits);
        }
        public optionCommunication()
        {
            CustomSerial gcodeChan = ComChannelFactory.getGCodeSerial();

            InitializeComponent();


            if (gcodeChan.IsOpen)
            {
                this.imgSerialMotorStatus.Image = BioBotApp.Properties.Resources.link;
            }
        }
Exemple #4
0
        public void sendGCode(string text)
        {
            Console.Out.WriteLine(text);
            CustomSerial movementSerial = ComChannelFactory.getGCodeSerial();

            movementSerial.configure("COM3", "115200", "8", "One", "None");
            movementSerial.Open();
            //movementSerial.WriteLine(text);
            movementSerial.Write("M105\n");
            //movementSerial.WriteLine("T1\n");

            System.Threading.Thread.Sleep(1000);
            movementSerial.Write("G91\n");
            movementSerial.Write("G1 X-300 F6000\n");
            System.Threading.Thread.Sleep(1000);
            movementSerial.ReadExisting();
            //movementSerial.ReadLine();
            movementSerial.Close();
        }
        private void btnSendTest_Click(object sender, EventArgs e)
        {
            CustomSerial gcodeChan = ComChannelFactory.getGCodeSerial();


            if (!gcodeChan.IsOpen)
            {
                gcodeChan.Open();
            }

            if (gcodeChan.IsOpen)
            {
                txtConsole.Text += txtTest.Text + Environment.NewLine;
                gcodeChan.WriteLine(txtTest.Text);
            }
            else
            {
                //afficher que l'on est pas connecte
            }
        }
        private void btnConnect_Click(object sender, EventArgs e)
        {
            CustomSerial gcodeChan = ComChannelFactory.getGCodeSerial();

            if (gcodeChan.IsOpen)
            {
                // on devrait jamais venir ici
            }

            gcodeChan.Open();

            if (gcodeChan.IsOpen)
            {
                this.btnConnect.Enabled = false;
            }
            else
            {
                this.btnConnect.Enabled = true;
            }
        }
        private void btnConnectMotor_Click(object sender, EventArgs e)
        {
            CustomSerial gcodeChan = ComChannelFactory.getGCodeSerial();

            if (gcodeChan.IsOpen)
            {
                // on devrait jamais venir ici
            }

            gcodeChan.Open();

            if (gcodeChan.IsOpen)
            {
                // si c'est pas ouvert on a un probleme
                this.imgSerialMotorStatus.Image = BioBotApp.Properties.Resources.link;
                this.btnConnectMotor.Enabled    = false;
            }
            else
            {
                this.imgSerialMotorStatus.Image = BioBotApp.Properties.Resources.link_break;
            }
        }
 public VIPCore(CustomSerial serial)
     : base(serial)
 {
 }
Exemple #9
0
 public BaseCore(CustomSerial serial)
     : base(serial)
 {
 }
Exemple #10
0
 public ToolbarCore(CustomSerial serial)
     : base(serial)
 {
 }
Exemple #11
0
 public VIPModule(CustomSerial serial)
     : base(serial)
 {
 }
 public AnimalBODModule(CustomSerial serial) : base(serial)
 {
     BaseCore.OnEnabledChanged += BaseCore_OnEnabledChanged;
 }
		public ToolbarModule(CustomSerial serial)
			: base(serial)
		{ }
Exemple #14
0
 public VIPCore(CustomSerial serial)
     : base(serial)
 {
 }
		public ToolbarCore(CustomSerial serial)
			: base(serial)
		{ }
Exemple #16
0
 public VIPModule(CustomSerial serial)
     : base(serial)
 {
 }
Exemple #17
0
 public SlayerModule(CustomSerial serial)
     : base(serial)
 {
 }
 public SlayerModule(CustomSerial serial)
     : base(serial)
 {
 }
Exemple #19
0
 public FoodEffectsCore(CustomSerial serial) : base(serial)
 {
 }
Exemple #20
0
 public SlayerTitleCore(CustomSerial serial) : base(serial)
 {
 }
        private static string GetStringFromObject(object o)
        {
            if (o == null)
            {
                return("-null-");
            }

            if (o is string)
            {
                return(String.Format("\"{0}\"", o));
            }

            if (o is bool)
            {
                return(o.ToString());
            }

            if (o is char)
            {
                return(String.Format("0x{0:X} '{1}'", (int)(char)o, (char)o));
            }

            if (o is Serial)
            {
                Serial s = (Serial)o;

                if (s.IsValid)
                {
                    if (s.IsItem)
                    {
                        return(String.Format("(I) 0x{0:X}", s.Value));
                    }

                    if (s.IsMobile)
                    {
                        return(String.Format("(M) 0x{0:X}", s.Value));
                    }
                }

                return(String.Format("(?) 0x{0:X}", s.Value));
            }

            if (o is CustomSerial)
            {
                CustomSerial s = (CustomSerial)o;

                if (s.IsValid)
                {
                    return(String.Format("(O) 0x{0:X}", s.Value));
                }

                return(String.Format("(?) 0x{0:X}", s.Value));
            }

            if (o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong)
            {
                return(String.Format("{0} (0x{0:X})", o));
            }

            if (o is Mobile)
            {
                return(String.Format("(M) 0x{0:X} \"{1}\"", ((Mobile)o).Serial.Value, ((Mobile)o).Name));
            }

            if (o is Item)
            {
                return(String.Format("(I) 0x{0:X} \"{1}\"", ((Item)o).Serial.Value, ((Item)o).Name));
            }

            if (o is Type)
            {
                return(((Type)o).Name);
            }

            return(o.ToString());
        }
Exemple #22
0
 public BaseService(CustomSerial serial)
     : base(serial)
 {
 }
Exemple #23
0
 public SlayerTitleCore(CustomSerial serial) : base(serial)
 {
 }
Exemple #24
0
 public FoodEffectModule(CustomSerial serial) : base(serial)
 {
     BaseCore.OnEnabledChanged += BaseCore_OnEnabledChanged;
 }
 public FoodEffectModule(CustomSerial serial) : base(serial)
 {
     BaseCore.OnEnabledChanged += BaseCore_OnEnabledChanged;
 }
Exemple #26
0
		public BaseModule(CustomSerial serial)
			: base(serial)
		{ }
Exemple #27
0
 public ShrinkSystemCore(CustomSerial serial) : base(serial)
 {
     BaseCore.OnEnabledChanged += BaseCore_OnEnabledChanged;
 }
Exemple #28
0
 public ToolbarModule(CustomSerial serial)
     : base(serial)
 {
 }
 public AnimalBODCore(CustomSerial serial) : base(serial)
 {
 }
 public FoodEffectsCore(CustomSerial serial) : base(serial)
 {
 }