public MccDeviceReader(Settings _settings)
        {
            settings = _settings;
            ISet<MccDaq.DigitalPortType> portsUsed = settings.getPortsUsed();
            tempBoard = new MccBoard(settings.TempBoardNumber);

            if (settings.TemperatureFormat == TemperatureFormatEnum.Farenheit)
            {
                tempScale = TempScale.Fahrenheit;
            }
            else
            {
                tempScale = TempScale.Celsius;
            }
            dioBoard = new MccBoard(settings.DIOBoardNumber);
            foreach (MccDaq.DigitalPortType portType in settings.getPortsUsed())
            {
                MccDaq.ErrorInfo ulStat = dioBoard.DConfigPort(portType, MccDaq.DigitalPortDirection.DigitalIn);
                if (ulStat.Value != ErrorInfo.ErrorCode.NoErrors)
                {
                    logger.Error("Error while configuring DIO Board : " + ulStat.Message);
                    throw new DeviceException("Error while configuring DIO Board : " + ulStat.Message);
                }
            }

            //    MccDaq.ErrorInfo ULStat = MccDaq.MccService.ErrHandling(MccDaq.ErrorReporting.PrintAll, MccDaq.ErrorHandling.StopAll);
        }
示例#2
0
        public string WeatherDataListing()
        {
            //Forms the weather data into a string separated by line feeds
            string wsList = "";

            if (weaList.Count > 0)
            {
                {
                    wsList += "WriteDate:\t" + ReportDate.ToString("hh:mm:ss");
                    wsList += "\r\n" + "TempScale:\t" + TempScale.ToString();
                    wsList += "\r\n" + "WindScale:\t" + WindScale.ToString();
                    wsList += "\r\n" + "SkyTemp:\t" + SkyTemp.ToString();
                    wsList += "\r\n" + "AmbTemp:\t" + AmbTemp.ToString();
                    wsList += "\r\n" + "SenTemp:\t" + SenTemp.ToString();
                    wsList += "\r\n" + "WindSpeed:\t" + WindSpeed.ToString();
                    wsList += "\r\n" + "Humidity:\t\t" + Humidity.ToString();
                    wsList += "\r\n" + "DewPoint:\t" + DewPoint.ToString();
                    wsList += "\r\n" + "DewHeat:\t" + DewHeat.ToString();
                    wsList += "\r\n" + "RainFlag:\t\t" + RainFlag.ToString();
                    wsList += "\r\n" + "WetFlag:\t\t" + WetFlag.ToString();
                    wsList += "\r\n" + "ElapsedTime:\t" + ElapsedSeconds.ToString();
                    wsList += "\r\n" + "LastDataWrite:\t" + LastDataWrite.ToString("hh:mm:ss");
                    wsList += "\r\n" + "Cloudiness:\t" + Cloudiness.ToString();
                    wsList += "\r\n" + "Windiness:\t" + Windiness.ToString();
                    wsList += "\r\n" + "Raininess:\t" + Raininess.ToString();
                    wsList += "\r\n" + "Darkness:\t" + Darkness.ToString();
                    wsList += "\r\n" + "RoofCloseFlag:\t" + RoofCloseFlag.ToString();
                    wsList += "\r\n" + "AlertFlag:\t\t" + AlertFlag.ToString();
                }
            }
            return(wsList);
        }
        static Temperature Convert(Temperature t, TempScale scale)
        {
            Temperature rv;

            rv.value = 32;
            rv.scale = TempScale.F;
            return(rv);
        }
        //Changing user preference for celsius or farenheit
        public ActionResult ChangeTempStyle(TempScale TempScale, string parkCode)
        {
            //check session dictionary for active temphelper
            TempHelper helper = GetActiveTempHelper();

            //set temperature preference bool
            helper.IsFarenheit = TempScale == TempScale.Fahrenheit;
            //redirect back to detail page with same parkCode
            return(Detail(parkCode));
        }
 // This function is called when the degree Celsius button in the GUI
 // is clicked. It changes the button color to Green and resets the color
 // of the other temperature scale buttons, so that the user knows which
 // temperature scale is currently being displayed.
 private void Celsius_Click(object sender, EventArgs e)
 {
     my_TempScale = TempScale.Celsius;
     Celsius.BackColor = Color.GreenYellow;
     Fahrenheit.BackColor = default(Color);
     Kelvin.BackColor = default(Color);
 }
示例#6
0
 public void OnKelvinOutToggled(object o, EventArgs args)
 {
     if (KelvinOut.Active) {
         outputTempScale = TempScale.Kelvin;
         dWriteLine("KelvinOut to : " + outputTempScale.ToString());
     }
 }
示例#7
0
 public void OnKelvinInToggled(object o, EventArgs args)
 {
     if (KelvinIn.Active) {
         inputTempScale = TempScale.Kelvin;
         dWriteLine("KelvinIn to : " + inputTempScale.ToString());
     }
 }
示例#8
0
 public void OnFahrenheitOutToggled(object o, EventArgs args)
 {
     if (FahrenheitOut.Active) {
         outputTempScale = TempScale.Fahrenheit;
         dWriteLine("FahrenheitOut to : " + outputTempScale.ToString());
     }
 }
示例#9
0
 public void OnFahrenheitInToggled(object o, EventArgs args)
 {
     if (FahrenheitIn.Active) {
         inputTempScale = TempScale.Fahrenheit;
         dWriteLine("FahrenheitIn to : " + inputTempScale.ToString());
     }
 }
示例#10
0
 public void OnCelciusOutToggled(object o, EventArgs args)
 {
     if (CelciusOut.Active) {
         outputTempScale = TempScale.Celcius;
         dWriteLine("CelciusOut to : " + outputTempScale.ToString());
     }
 }
示例#11
0
 public void OnCelciusInToggled(object o, EventArgs args)
 {
     if (CelciusIn.Active) {
         inputTempScale = TempScale.Celcius;
         dWriteLine("CelciusIn to : " + inputTempScale.ToString());
     }
 }
示例#12
0
 // This function is called when the Kelvin scale button in the GUI is
 // clicked. It changes the button color to Green and resets the color
 // of the other temperature scale buttons, so that the user knows which
 // temperature scale is currently being displayed.
 private void Kelvin_Click(object sender, EventArgs e)
 {
     my_TempScale = TempScale.Kelvin;
     CelsiusButton.BackColor = default(Color);
     FahrenheitButton.BackColor = default(Color);
     KelvinButton.BackColor = Color.GreenYellow;
 }