WFA_psychometric_chart.Form1_main.SetNode C# (CSharp) Method

SetNode() public method

public SetNode ( string temperature_sourceVal, string humidity_sourceVal, string name, Color c1, int markerSize1, string lineNameVal, int lineStatusVal, int airflow ) : void
temperature_sourceVal string
humidity_sourceVal string
name string
c1 Color
markerSize1 int
lineNameVal string
lineStatusVal int
airflow int
return void
        public void SetNode(string temperature_sourceVal,string humidity_sourceVal, string name,  Color c1,int markerSize1, string lineNameVal, int lineStatusVal,int airflow)
        {

            //--Here we are updating the variables for storing 
           // tbSource = source;
            tbName = name;
           // tbLabel = label;
            colorValue = c1;
           // comboboxItemText = comboboxItemText1;
            markerSize = markerSize1;
            lineName = lineNameVal;
            lineStatus_ON_OFF = lineStatusVal;
            //lets do the processing 
            //lets count how many items were inserted
            countNumberOfPoints += 1;
            //--New added items
            temperature_sourceGlobal = temperature_sourceVal;
            humidity_sourceGlobal = humidity_sourceVal;
            airFlowValueGlobal = airflow;
            //lets get the coordinates to plot on the graph..
            //this will be set on right click..not here


            //lets process the data 
            /*
            calculating the humidity and temperature value form the coordinates..
            */
            HumTempCalcByCoordinate();
            //MessageBox.Show("Temp= " + temperatureValue + ",hum = " + humidityValue);

            //now lets plot the values only when the humidity is <= 100 and temp >0  and < 50
            if ((humidityValue > 0 && humidityValue <= 100) && (temperatureValue >= 0 && temperatureValue <= 50))
            {
                //now lets plot the values....
                plot_by_DBT_HR_process_diagram((double)(int)temperatureValue, (double)humidityValue / 100);
            }
            else
            {
                MessageBox.Show(Properties.Resources.Please_select_a_proper_region_);
            }
         
        }

Usage Example

Example #1
0
        private void btnSetNode_Click(object sender, EventArgs e)
        {
            /*
             * This set node should do two task
             * 1. Insert a point by calling a function
             * 2. It should input the values in menuStripNodeInfoValues
             */
            string source         = tbSource.Text;
            string name           = tbName.Text;
            string label          = tbLabel.Text;
            string cbItemSelected = comboBox1.Text;

            //MessageBox.Show("items index " + cbItemSelected);


            F1.SetNode(source, name, label, btnColor.BackColor, cbItemSelected);
            //MessageBox.Show(Properties.Resources.Success0);
            this.Close();
        }
Form1_main