コード例 #1
0
        private void ExoReadings_exoRead(exo_waterquality exor)
        {

            exor.setLatLon(currentlat, currentlon);

            if (sw != null)
            {
                sw.WriteLine(exor.toText());
            }


            Exodata.Add(exor);

            if (exoRead != null)
                exoRead(exor);
        }
コード例 #2
0
ファイル: MsgRouter.cs プロジェクト: lmhonorio/TrimaresRouter
        private void timer1_Tick_1(object sender, EventArgs e)
        {
            exo_waterquality exor = new exo_waterquality();
            exor.time_usec = Convert.ToUInt64(exo_waterquality.returnID());           
            exor.chloride = 9.65f + (float)(rnd.NextDouble() * 10f);
            exor.depth = 10f  + (float)(rnd.NextDouble() * 8f);
            exor.temperature = 29.65f + (float)(rnd.NextDouble() * 5f) - 0.5f*exor.depth;

            MAVLink.mavlink_exo_waterquality_t mavlinkexo = (MAVLink.mavlink_exo_waterquality_t)exor;

            lock (locker) 
            {
                mavlinkexo.lat = lat;
                mavlinkexo.lon = lon;
            }

            //if (MissionTCPServerConn != null && MissionTCPServerConn.mydata.myLink.BaseStream.IsOpen) 
            //{
            //    MissionTCPServerConn.mydata.myLink.sendPacket(mavlinkexo);
            //}

            if (MissionPlannerServer != null && MissionPlannerServer.IsOpen)
            {
                //MissionPlannerServer.  sendPacket(mavlinkexo);
                 byte[] pck = mavComm.ReturnByteArray(mavlinkexo);
                 MissionPlannerServer.Write(pck, 0, pck.Length);
                //MissionTCPServerConn.mydata.myLink.ReturnByteArray(mavlinkexo);
            }


            if (ExoMonitorServer != null && ExoMonitorServer.IsOpen)
            {
                //MissionPlannerServer.  sendPacket(mavlinkexo);
                byte[] pck = mavComm.ReturnByteArray(mavlinkexo);
                ExoMonitorServer.Write(pck, 0, pck.Length);
                //MissionTCPServerConn.mydata.myLink.ReturnByteArray(mavlinkexo);
            }
        }
コード例 #3
0
ファイル: MsgRouter.cs プロジェクト: lmhonorio/TrimaresRouter
        void ExoReadings_exoRead(exo_waterquality exor)
        {

            try
            {
                current = exor;

                if (current.id != 0 && current.id != lastexo.id)
                {

                    lastexo = current;
                    Treadings = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(SendingReadings));
                    Treadings.Priority = System.Threading.ThreadPriority.Highest;
                    Treadings.Start(lastexo);

                }


                this.Invoke((MethodInvoker)delegate()
                  {

                      source.ResetBindings(true);

                      tx_utime.Text = exor.time_usec.ToString();
                      tx_lat.Text = exor.lat.ToString();
                      tx_lon.Text = exor.lon.ToString();
                      tx_id.Text = exor.id.ToString();
                      tx_chloride.Text = exor.chloride.ToString();
                      tx_condctivity.Text = exor.conductivity.ToString();
                      tx_conductance.Text = exor.conductance.ToString();
                      tx_depth.Text = exor.depth.ToString();
                      tx_salinity.Text = exor.salinity.ToString();
                      tx_temperature.Text = exor.temperature.ToString();
                      tx_turbidity.Text = exor.turbidity.ToString();
                      tx_nlf.Text = exor.nLF.ToString();
                      tx_ph.Text = exor.ph.ToString();
                      tx_tds.Text = exor.tot_dissolved_solids.ToString();
                      tx_do.Text = exor.dissolved_oxygen.ToString();
                  });
            }
            catch { }

        }
コード例 #4
0
        public void convert(string x)
        {
            try
            {

                string[] par = x.Split(" ".ToCharArray());

                if (x.Length > 20 && par.Length == 15)
                {
                    exo_waterquality exo = new exo_waterquality();
                    exo.setValues(par);
                    exoRead(exo);
                    dataread(x);
                }
                else
                {
                   // dataread(x);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }