Rozdíly
Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.
Obě strany předchozí revize Předchozí verze Následující verze | Předchozí verze | ||
cs:mervis-db:10-api [2021/10/25 09:05] v.kohout [C#] |
cs:mervis-db:10-api [2024/05/08 10:42] (aktuální) |
||
---|---|---|---|
Řádek 25: | Řádek 25: | ||
^GetVariableStatsAsync|Obsolete| | ^GetVariableStatsAsync|Obsolete| | ||
^CheckCredentials| | | ^CheckCredentials| | | ||
+ | |||
+ | ===== Vlastnosti objektu ===== | ||
+ | * (UTC) Časová známka - UTC časová známka záznamu | ||
+ | * Platnost do - UTC časová známka konce platnosti konkrétního záznamu | ||
+ | * Interval - doba (v sekundách), | ||
===== Příklady použití ===== | ===== Příklady použití ===== | ||
Řádek 157: | Řádek 162: | ||
class Program | class Program | ||
{ | { | ||
- | static | + | static |
{ | { | ||
- | // | + | try |
- | // Demo of asynchronous methods. | + | |
- | // | + | |
- | var task = Task.Run(async () => | + | |
{ | { | ||
// | // | ||
Řádek 169: | Řádek 171: | ||
// The client is automatically generated from the WSDL file available here: https:// | // The client is automatically generated from the WSDL file available here: https:// | ||
// | // | ||
- | using (HistoryDbAccessClient client = new HistoryDbAccessClient("HistoryAccess", " | + | using (HistoryDbAccessClient client = new HistoryDbAccessClient(HistoryDbAccessClient.EndpointConfiguration.HistoryAccess, |
{ | { | ||
// Authentication credetials in the database. | // Authentication credetials in the database. | ||
Řádek 186: | Řádek 188: | ||
rec.DoubleValue = 23.4; // value itself | rec.DoubleValue = 23.4; // value itself | ||
rec.Interval = 60.0; // sampling period in seconds. When the difference of timestamps of subsequent values if greater than 1.1 multiple of the interval, the data should be considered incomplete. | rec.Interval = 60.0; // sampling period in seconds. When the difference of timestamps of subsequent values if greater than 1.1 multiple of the interval, the data should be considered incomplete. | ||
- | rec.Keys = new KeyValuePair[] // | + | rec.Keys = new ESG.Db.Server.Shared.KeyValuePair[] // |
{ | { | ||
- | new KeyValuePair | + | new |
- | new KeyValuePair | + | new |
- | new KeyValuePair | + | new |
- | new KeyValuePair | + | new |
- | new KeyValuePair | + | new |
- | new KeyValuePair | + | new |
}; | }; | ||
Řádek 203: | Řádek 205: | ||
Console.WriteLine(" | Console.WriteLine(" | ||
} | } | ||
- | }); | ||
- | Console.WriteLine(" | ||
- | |||
- | try | ||
- | { | ||
- | task.Wait(); | ||
} | } | ||
catch (Exception exc) | catch (Exception exc) | ||
Řádek 277: | Řádek 273: | ||
} | } | ||
- | var res = await dbClient.ReplaceDataAsync(new List< | + | var res = await dbClient.ReplaceDataAsync(new List< |
} | } | ||
} | } | ||
Řádek 293: | Řádek 289: | ||
class Program | class Program | ||
{ | { | ||
- | static | + | static |
{ | { | ||
// | // | ||
- | // Demo of asynchronous method. | + | // Create access to the real server. |
+ | // Without SSL connections, | ||
+ | // The client is automatically generated from the WSDL file available here: https:// | ||
// | // | ||
- | var task = Task.Run(async () => | + | try |
{ | { | ||
- | // | + | using (HistoryDbAccessClient client = new HistoryDbAccessClient(HistoryDbAccessClient.EndpointConfiguration.HistoryAccess, |
- | // Create access to the real server. | + | |
- | // Without SSL connections, | + | |
- | // The client is automatically generated from the WSDL file available here: https:// | + | |
- | // | + | |
- | using (HistoryDbAccessClient client = new HistoryDbAccessClient("HistoryAccess", " | + | |
{ | { | ||
// Authentication credentials in the database. | // Authentication credentials in the database. | ||
Řádek 312: | Řádek 305: | ||
// Specification of the variables through Key-Value. | // Specification of the variables through Key-Value. | ||
// Here we use 2 variables. | // Here we use 2 variables. | ||
- | KeyValuePair[][] variableKeys = new KeyValuePair[][] { | + | ESG.Db.Server.Shared.KeyValuePair[][] variableKeys = new ESG.Db.Server.Shared.KeyValuePair[][] { |
- | new KeyValuePair[] { | + | new |
- | new KeyValuePair (false, /*Key*/ " | + | new |
- | new KeyValuePair (false, /*Key*/ " | + | new |
}, | }, | ||
- | new KeyValuePair[] { | + | new |
- | new KeyValuePair (false, /*Key*/ " | + | new |
- | new KeyValuePair (false, /*Key*/ " | + | new |
} | } | ||
}; | }; | ||
Řádek 330: | Řádek 323: | ||
aggregation.IsoPattern = new string[] { " | aggregation.IsoPattern = new string[] { " | ||
aggregation.From = new DateTime(2018, | aggregation.From = new DateTime(2018, | ||
- | aggregation.To = | + | aggregation.To = new DateTime(2018, |
aggregation.TimeZone = @" | aggregation.TimeZone = @" | ||
Řádek 384: | Řádek 377: | ||
} while (variableOffset != -1); | } while (variableOffset != -1); | ||
} | } | ||
- | }); | ||
Console.WriteLine(" | Console.WriteLine(" | ||
- | try | ||
- | { | ||
- | task.Wait(); | ||
} | } | ||
catch (Exception exc) | catch (Exception exc) | ||
Řádek 401: | Řádek 390: | ||
Console.ReadLine(); | Console.ReadLine(); | ||
} | } | ||
- | |||
} | } | ||
} | } |