Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Sensor
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Instantierea clasei SensorValue\n\r");
- //instantiere folosind constructorul implicit. Valorile de masurare se dau folosind proprietatile
- SensorValue sensor1 = new SensorValue();
- sensor1.Type = SensorType.BloodGlucose;
- sensor1.TimeStamp = DateTime.Now;
- sensor1.Value = 100; //mg/dl
- DisplaySensorValues("Primul sensor initializat", sensor1);
- //instantiere folosind constructorul cu parametri
- SensorValue sensor2 = new SensorValue(SensorType.SkinTemperature, 36.7, "23-Jan-10 14:56");
- DisplaySensorValues("Al doilea sensor initializat", sensor2);
- PumpSensorValues sensorValuesPump = new PumpSensorValues("0101", 3);
- sensorValuesPump.StartPumping();
- Console.ReadLine();
- sensorValuesPump.StopPumping();
- internal static void DisplaySensorValues(string headerText,SensorValue sensor)
- {
- Console.WriteLine("\t" + headerText);
- Console.WriteLine("\t\t Type = {0}", sensor.Type.ToString());
- Console.WriteLine("\t\t TimeStamp={0}", sensor.TimeStampString);
- Console.WriteLine("\t\t Value={0}", sensor.Value.ToString("0.00"));
- }
- PumpSensorValues sensorValuesPump = new PumpSensorValues(3);
- sensorValuesPump.StartPumping();
- Console.ReadLine();
- sensorValuesPump.StartPumping();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement