예제 #1
0
 internal UsbEndpointBase(UsbDevice usbDevice, EndpointTypes epType, int packetSize)
 {
     mPacketSize      = packetSize;
     mEpType          = epType;
     mUsbDevice       = usbDevice;
     mTransferContext = new TransferContext(this);
 }
예제 #2
0
파일: RouteDetails.cs 프로젝트: uvbs/babbot
 public QuestObjListEndpoint(RouteDetails owner,
                             Panel target, char a_b, EndpointTypes etype)
     : base(owner, target, a_b, etype,
            new string[] { "bsQuestList", "fkQuestItems" },
            new string[] { "TITLE", "NAME" })
 {
 }
예제 #3
0
        public AbstractDefListEndpoint(RouteDetails owner, Panel target, 
            char a_b, EndpointTypes etype, string[] bs_list, string[] members)
            : base(owner, target, a_b, etype)
        {
            _bs_cnt = bs_list.Length;
            DisplayMembers = members;
            bs = new BindingSource[_bs_cnt];

            for (int i = 0; i < bs_list.Length; i++)
                bs[i] = FindBindingSource(bs_list[i]);
        }
예제 #4
0
        public SchoolContext GetContext(EndpointTypes endpointTypes)
        {
            IConfigurationRoot configuration = GetConfiguration();

            var builder          = new DbContextOptionsBuilder <SchoolContext>();
            var connectionString = configuration.GetConnectionString(endpointTypes.ToString());

            builder.UseMySql(connectionString);

            return(new SchoolContext(builder.Options));
        }
예제 #5
0
        public string getCurrentWeather(string latitude, string longitude, EndpointTypes endpointType)
        {
            StringBuilder stringBuilder = new StringBuilder(baseEndpoint);

            stringBuilder.Append($"{version}/{endpointTypeDictionary[endpointType]}");
            stringBuilder.Append($"?apikey={apiKey}");
            stringBuilder.Append($"&lat={latitude}");
            stringBuilder.Append($"&lon={longitude}");
            stringBuilder.Append("&fields=temp:C");

            return(stringBuilder.ToString());
        }
예제 #6
0
        public float getCurrentTemperature(string city, EndpointTypes endpointTypes)
        {
            restClient.endpoint = openWeatherMapEndpoint.getByCityNameEndpoint(city, endpointTypes);
            string response = restClient.makeRequest();

            JSONParser <OpenWeatherMapWeatherModel> jsonParser         = new JSONParser <OpenWeatherMapWeatherModel>();
            OpenWeatherMapWeatherModel deserializedOpenWeatherMapModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3);

            float temperature = deserializedOpenWeatherMapModel.main.temp;

            return(temperature);
        }
예제 #7
0
        public float getCurrentWeather(string latitude, string longitude, EndpointTypes endpointTypes)
        {
            restClient.endpoint = climaCellEndpoint.getCurrentWeather(latitude, longitude, endpointTypes);
            string response = restClient.makeRequest();

            JSONParser <ClimaCellWeatherModel> jsonParser = new JSONParser <ClimaCellWeatherModel>();

            ClimaCellWeatherModel deserialisedClimaCellWeatherModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3);

            float value = deserialisedClimaCellWeatherModel.temp.value;

            return(value);
        }
예제 #8
0
파일: RouteDetails.cs 프로젝트: uvbs/babbot
        public AbstractDefListEndpoint(RouteDetails owner, Panel target,
                                       char a_b, EndpointTypes etype, string[] bs_list, string[] members)
            : base(owner, target, a_b, etype)
        {
            _bs_cnt        = bs_list.Length;
            DisplayMembers = members;
            bs             = new BindingSource[_bs_cnt];

            for (int i = 0; i < bs_list.Length; i++)
            {
                bs[i] = FindBindingSource(bs_list[i]);
            }
        }
예제 #9
0
파일: RouteDetails.cs 프로젝트: uvbs/babbot
        public UndefListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype)
        {
            C           = a_b;
            Owner       = owner;
            _etype      = etype;
            PTargets[0] = target;

            for (int i = 0; i < 2; i++)
            {
                PTargets[i + 1] = (Panel)PTargets[i].Tag;
                cb_list[i]      = (ComboBox)PTargets[i + 1].Controls["cbObj" + C + i];
            }
        }
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            EndpointTypes original = (EndpointTypes)value;

            if (original == EndpointTypes.Local)
            {
                return(Visibility.Collapsed);
            }
            else
            {
                return(Visibility.Visible);
            }
        }
예제 #11
0
        public string getForecast(string latitude, string longitude, EndpointTypes endpointType)
        {
            StringBuilder stringBuilder = new StringBuilder(baseEndpoint);

            stringBuilder.Append($"{version}/{endpointTypeDictionary[endpointType]}");
            stringBuilder.Append($"?apikey={apiKey}");
            stringBuilder.Append($"&lat={latitude}");
            stringBuilder.Append($"&lon={longitude}");
            stringBuilder.Append("&start_time=now");
            //stringBuilder.Append($"&end_time={currentTime}");
            stringBuilder.Append("&fields=temp:C");

            return(stringBuilder.ToString());
        }
예제 #12
0
        public string getByCityNameEndpoint(string cityName, EndpointTypes endpointType)
        {
            StringBuilder stringBuilder = new StringBuilder(baseEndpoint);

            stringBuilder.Append($"{version}");
            stringBuilder.Append($"/{endpointTypeDictionary[endpointType]}");
            stringBuilder.Append("?q=");
            stringBuilder.Append(cityName);
            stringBuilder.Append("&appid=");
            stringBuilder.Append(apiKey);
            stringBuilder.Append("&units=");
            stringBuilder.Append(units);

            return(stringBuilder.ToString());
        }
예제 #13
0
        public List <OpenWeatherMapForecast> getForecastList(string city, EndpointTypes endpointTypes)
        {
            List <OpenWeatherMapForecast> forecastList = new List <OpenWeatherMapForecast>();

            restClient.endpoint = openWeatherMapEndpoint.getByCityNameEndpoint(city, endpointTypes);
            string response = restClient.makeRequest();

            JSONParser <OpenWeatherMapForecastModel> jsonParser = new JSONParser <OpenWeatherMapForecastModel>();
            OpenWeatherMapForecastModel deserializedOpenWeatherMapForecastModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3);

            foreach (ForecastModel.UnnamedObject forecastMain in deserializedOpenWeatherMapForecastModel.list)
            {
                DateTime dateTime = DateTimeOffset.FromUnixTimeSeconds(forecastMain.dt).UtcDateTime;
                forecastList.Add(new OpenWeatherMapForecast(dateTime, forecastMain.main.temp));
            }

            return(forecastList);
        }
예제 #14
0
 internal UsbEndpointReader(UsbDevice usbDevice, EndpointTypes epType, int packetSize, int mReadBufferSize, ReadEndpoints mReadEndpoint)
     : base(usbDevice, epType, packetSize)
 {
     this.mReadBufferSize = mReadBufferSize;
     this.mReadEndpoint   = mReadEndpoint;
 }
예제 #15
0
 public Route Record(EndpointTypes type_a, string name_a,
                     EndpointTypes type_b, string name_b)
 {
     return(null);
 }
예제 #16
0
파일: UsbDevice.cs 프로젝트: zoobab/CH554
        /// <summary>
        /// Opens an endpoint for reading
        /// </summary>
        /// <param name="readEndpoint">Endpoint number for read operations.</param>
        /// <param name="readBufferSize">Size of the read buffer allocated for the <see cref="UsbEndpointReader.DataReceived"/> event.</param>
        /// <param name="endPointType">One of the <see cref="EndpointTypes"/> enumerations.</param>
        /// <param name="packetSize">The packet size to use when endPointType is set to <see cref="EndpointTypes.Isochronous"/>.</param>
        /// <returns>A <see cref="UsbEndpointReader"/> class ready for reading.
        /// If the specified endpoint has allready been opened, the original <see cref="UsbEndpointReader"/> object will be returned.
        /// </returns>
        public UsbEndpointReader OpenEndpointReader(ReadEndpoints readEndpoint, int readBufferSize, EndpointTypes endPointType, int packetSize)
        {
            UsbEndpointReader epNew = new UsbEndpointReader(this, endPointType, packetSize, readBufferSize, readEndpoint);

            return((UsbEndpointReader)mActiveEndpoints.Add(epNew));
        }
예제 #17
0
 public HotSpotListEndpoint(RouteDetails owner, 
     Panel target, char a_b, EndpointTypes etype)
     : base(owner, target, a_b, etype)
 {
 }
예제 #18
0
        public List <ClimaCellForecast> getForecast(string latitude, string longitude, EndpointTypes endpointTypes)
        {
            List <ClimaCellForecast> forecastList = new List <ClimaCellForecast>();

            restClient.endpoint = climaCellEndpoint.getForecast(latitude, longitude, endpointTypes);
            string response = restClient.makeRequest();

            JSONParser <ClimaCellForecastModel> jsonParser = new JSONParser <ClimaCellForecastModel>();

            ClimaCellForecastModel deserialisedClimaCellForecastModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3);

            foreach (Forecast climaCell in deserialisedClimaCellForecastModel.temp)
            {
                forecastList.Add(new ClimaCellForecast(climaCell.observation_time, climaCell.min.value,
                                                       climaCell.min.units));
                //forecastList.Add(new ClimaCellForecast(climaCell.observation_time, climaCell.max.value, climaCell.max.units));
            }

            return(forecastList);
        }
예제 #19
0
파일: RouteDetails.cs 프로젝트: uvbs/babbot
 public GameObjListEndpoint(RouteDetails owner,
                            Panel target, char a_b, EndpointTypes etype)
     : base(owner, target, a_b, etype, new string[] { "bsGameObjects" },
            new string[] { "NAME" })
 {
 }
예제 #20
0
        public UndefListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype)
        {
            C = a_b;
            Owner = owner;
            _etype = etype;
            PTargets[0] = target;

            for (int i = 0; i < 2; i++)
            {
                PTargets[i + 1] = (Panel)PTargets[i].Tag;
                cb_list[i] = (ComboBox)PTargets[i + 1].Controls["cbObj" + C + i];
            }
        }
예제 #21
0
 public GameObjListEndpoint(RouteDetails owner, 
     Panel target, char a_b, EndpointTypes etype)
     : base(owner, target, a_b, etype, new string[] { "bsGameObjects" },
                                         new string[] { "NAME" })
 {
 }
예제 #22
0
 internal UsbEndpointWriter(UsbDevice usbDevice, EndpointTypes epType, int packetSize, WriteEndpoints mWriteEndpoint)
     : base(usbDevice, epType, packetSize)
 {
     this.mWriteEndpoint = mWriteEndpoint;
 }
예제 #23
0
 public QuestObjListEndpoint(RouteDetails owner, 
     Panel target, char a_b, EndpointTypes etype)
     : base(owner, target, a_b, etype,
         new string[] { "bsQuestList", "fkQuestItems" },
                     new string[] { "TITLE", "NAME" })
 {
 }
예제 #24
0
파일: UsbDevice.cs 프로젝트: zoobab/CH554
        /// <summary>
        /// Opens an endpoint for writing
        /// </summary>
        /// <param name="writeEndpoint">Endpoint number for read operations.</param>
        /// <param name="endPointType">One of the <see cref="EndpointTypes"/> enumerations.</param>
        /// <param name="packetSize">The packet size to use when endPointType is set to <see cref="EndpointTypes.Isochronous"/>.</param>
        /// <returns>A <see cref="UsbEndpointWriter"/> class ready for writing.
        /// If the specified endpoint has allready been opened, the original <see cref="UsbEndpointWriter"/> object will be returned.
        /// </returns>
        public UsbEndpointWriter OpenEndpointWriter(WriteEndpoints writeEndpoint, EndpointTypes endPointType, int packetSize)
        {
            UsbEndpointWriter epNew = new UsbEndpointWriter(this, endPointType, packetSize, writeEndpoint);

            return((UsbEndpointWriter)mActiveEndpoints.Add(epNew));
        }
예제 #25
0
파일: RouteDetails.cs 프로젝트: uvbs/babbot
 public GraveyardListEndpoint(RouteDetails owner,
                              Panel target, char a_b, EndpointTypes etype)
     : base(owner, target, a_b, etype)
 {
 }
예제 #26
0
 public Route Record(EndpointTypes type_a, string name_a, 
                             EndpointTypes type_b, string name_b)
 {
     return null;
 }