Changes

UBIK Console

2,407 bytes added, 13:55, 30 November 2018
=== Mono and Roslyn ===
The console can either execute using Roslyn or Mono. By typing ''#mono'' or ''#roslyn'' you can switch between these engines. The default is Roslyn.
 
<source lang=C#>
>//build up a connection to a UBIK database
>var demo = new UBIKEnvironmentConnection("Data Source = AUGLNZ2SQL2016; Initial Catalog = UBIK.DEMO.262; Persist Security Info = True; User ID = sa; Password = ai#2011");
Connecting ('Data Source=AUGLNZ2SQL2016;Initial Catalog=UBIK.DEMO.262;Persist Security Info=True;User ID=sa;Password=********')
Database version: 2.6.2.0
Kernel version: 2.6.0.0
Customizing version: 2.6.215
Session mgmt. type: SingleLocal_Management
USAM ignored.
bma (AUGBMA02) now connected to 'UBIK.DEMO.262'.
 
>//get one of the metaclasses
>var metaclassOfPump = demo.Environment.UBIKDataFactory().MetaClass(new Guid("b81a9d31-03b2-4dbd-91aa-b62c499011f7"));
 
>//find a content object (e.g. the first one found containing "PU212"
>var myFavouritePump = metaclassOfPump.AllChilds().First(p => p.DisplayString.Contains("PU212"));
 
>//show all propertyvalues
>foreach(var prop in myFavouritePump.Properties) //%
>{ //%
> Console.WriteLine("{0} = {1}", prop.Description, prop.DisplayValue()); //%
>}
 
Shutdown finished = False
RPM = 2920
Flow rate = 68
Nominal Diameter DN1 = 80
Protection = II 2 G c TX
Nominal Power (Process) = 55
Static Head = 18
Nominal Power (electrical) = 50
Live RPM = (RPM)
Live Flow = (Flow1)
Height = 750
Live Manz =
Nominal Diameter DN2 = 60
Nominal Pressure PN2 = 20
Variable Frequency Drive = False
Volt = 400
Impeller Diameter = 120
Nominal Pressure PN1 = 16
Extension Weller =
Weight = 234
ARMARKERID =
TRANSLATIONY =
Installation Level = 60
Parent POI Group ID = DEMO_LEVEL_1 (Demo Level 1)
Technical Status = 0
RFID Tag =
Organisational Status = 0
Type = KSB Kreiselpumpe
TRANSLATIONX =
Layer ID = ML_PUMP (Pumps)
ROTAIONY =
ISFACINGCAMERA =
Position Number = A12345
QR Code = PU212
ROTAIONZ =
Maintenance state =
ROTAIONX =
Order Number = SAP987456
Barcode = PU212
Marker ID = 2
OCRText = PU212
SCALEX =
ARMARKERSIDELENGTH =
Weblink = http://www.augmensys.com
Progress = 50
TRANSLATIONZ =
Manufacturer = KSB AG
Weight = 6
Maintenance finished = False
Geo data = 46,6152954101563;14,2624282836914;0
Visio group ID =
LK to Structure =
Scan = PU212
Order ID =
SAP-ID = 210100092
Namespace = DemoHL
Name = PU212
Description = Effluent Discharge Pumpx
Create Session =
Created on = 22.07.2013 14:43:20
Delete status = 0
UTS = 27.11.2018 17:18:33
Update session = MHM@unknown device -- 27.11.2018 10:40:13
Tenant =
Version = 983
>
</source>
== Example using Script file ==
681
edits