Exemplo n.º 1
0
        public OpResult SaveDriver(IDriver newDriver)
        {
            OpResult result = OpResult.Success;

            if (newDriver == null)
                result = OpResult.NullParameter;

            if (result == OpResult.Success)
            {
                if(newDriver.Validate())
                {
                    try
                    {
                        result = _dataProvider.Save(newDriver);
                    }
                    catch (Exception ex)
                    {
                        result = OpResult.ExceptionOccurred;
                        _logger.TraceException(ex.Message, ex);
                    }
                }
                else
                {
                    result = OpResult.InvalidParameters;
                }
            }
            return result;
        }
Exemplo n.º 2
0
        public IEnumerable<IElement> ReturnElements(IDriver driver)
        {
            IEnumerable<IElement> elements = null;
            if (SelectorType == SelectorType.Name)
            {
                elements = driver.FindElementsByXpath(SelectorValue);
            }

            if (SelectorType == SelectorType.Id)
            {
                elements = driver.FindElementsById(SelectorValue);

            }

            if (SelectorType == SelectorType.ClassName)
            {
                elements = driver.FindElementsByCss(SelectorValue);
            }

            if (SelectorType == SelectorType.XPath)
            {
                elements = driver.FindElementsByXpath(SelectorValue);
            }

            if (elements == null)
                throw new InvalidOperationException(this.SelectorValue);

            return elements;
        }
Exemplo n.º 3
0
        public SqlMapperPersistenceEngine(string connectionString, IDriver driver, DBDialect dialect, Mapping mapping, ArrayList cacheEntries, Models.Model model)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException("connectionString");
            }
            if (driver == null)
            {
                throw new ArgumentNullException("driver");
            }
            if (dialect == null)
            {
                throw new ArgumentNullException("dialect");
            }
            if (mapping == null)
            {
                throw new ArgumentNullException("mapping");
            }
            this.Driver = driver;
            this.Dialect = dialect;
            this._Mapping = mapping;
            this._Connection = this._Driver.CreateConnection(connectionString);

            if (_Connection is Evaluant.Uss.Data.FileClient.FileConnection)
            {
                ((Evaluant.Uss.Data.FileClient.FileConnection)_Connection).Dialect = dialect;
            }

            base._Model = model;
            this._CacheEntries = cacheEntries;
            this.Initialize();
        }
Exemplo n.º 4
0
        public IElement ReturnElement(IDriver driver)
        {
            IElement el = null;
            if(SelectorType == SelectorType.Name)
            {
                el = driver.FindByName(SelectorValue);
            }

            if(SelectorType == SelectorType.Id)
            {
                el = driver.FindById(SelectorValue);
            }

            if(SelectorType == SelectorType.ClassName)
            {
                el = driver.FindByCss(SelectorValue);
            }

            if (SelectorType == SelectorType.XPath)
            {
                el = driver.FindByXpath(SelectorValue);
            }

            if (el == null)
                throw new InvalidOperationException(this.SelectorValue);

            return el;
        }
Exemplo n.º 5
0
 public static string synchronize(bool isJS, IDriver driver, IEnumerable<BuildIds> buildIds, IEnumerable<Langs> locs) {
   var src = buildEnvelopes.adjust();
   var dest = driver.readMap();
   var delta = src.synchronize(dest, isJS, buildIds, locs);
   if (delta == null) return "Up-to-date";
   driver.update(delta);
   return string.Format("Deleted: {0}, updated: {1}, inserted: {2}", delta.delete.Count, delta.update.Count, delta.insert.Count);
 }
 public override void Up(IDriver driver, ILogger logger, ISchemaInfo schemaInfo)
 {
     using (var trans = driver.Database.BeginTransaction())
     {
         base.Up(driver, logger, schemaInfo);
         trans.Commit();
     }
 }
Exemplo n.º 7
0
		static bool CheckDriver(IDriver driver)
		{
			if (!driver.IsExistLicence | !driver.IsExistCarDocuments)
			{
				return false;
			}

			return true;
		}
Exemplo n.º 8
0
        private Model _collisionSphereModel; //sometimes not used if collision shere display is comented out

        #endif

        #region Constructors

        public BasePawn(string resourcePath, IDriver driver = null, Vector3 rotation= new Vector3())
        {
            _resourcePath = resourcePath;
            CollisionsHelper = ServiceLocator.Current.GetInstance<CollisionHelper>();

            Movement = new Vector3();
            Driver = driver;
            Rotation = rotation;
        }
Exemplo n.º 9
0
 public static void Init(ILogger logger = null, IAssert assert = null,
     TimeoutSettings timeouts = null, IDriver<IWebDriver> driverFactory = null)
 {
     DriverFactory = driverFactory ?? new WebDriverFactory();
     Asserter = assert ?? new WebAssert();
     Timeouts = timeouts ?? new WebTimeoutSettings();
     Logger = logger ?? new LogAgregator(new NUnitLogger(), new Log4Net());
     MapInterfaceToElement.Init(DefaultInterfacesMap);
 }
Exemplo n.º 10
0
 public System.Data.IDataParameter[] GetParamters(object data,IDriver driver)
 {
     IDataParameter[] parameters = new IDataParameter[mParameters.Count];
     for (int i = 0; i < mParameters.Count; i++)
     {
         ProcParameterAttribute procp = mParameters[i];
         parameters[i] = driver.CreateProcParameter(procp.Name,
             procp.Handler.Get(data), procp.Direction);
     }
     return parameters;
 }
Exemplo n.º 11
0
 public Driver(MySqlConnectionStringBuilder settings)
 {
     encoding = Encoding.GetEncoding(1252);
     if (encoding == null)
         throw new MySqlException(Resources.DefaultEncodingNotFound);
     connectionString = settings;
     serverCharSet = "latin1";
     serverCharSetIndex = -1;
     maxPacketSize = 1024;
     handler = new NativeDriver(this);
 }
Exemplo n.º 12
0
 public IDbCommand CreateCommand(IDriver driver)
 {
     IDbCommand cmd = driver.Command;
     cmd.CommandText = driver.ReplaceSql(SqlText.ToString());
     cmd.CommandType = CommandType;
     DbCommand = cmd;
     foreach (Parameter p in Parameters)
     {
         cmd.Parameters.Add(driver.CreateParameter(p.Name, p.Value, p.Direction));
     }
     return cmd;
 }
Exemplo n.º 13
0
        public YandexTest(Configuration config, IDriver driver)
            : base(config, driver)
        {
            this.loginPage = new LoginPage(driver, config);

            this.userName = config.Get[Configuration.UserName];
            this.password = config.Get[Configuration.Password];
            this.recipient = config.Get[Configuration.Recipient];
            this.subject = config.Get[Configuration.BrowserName] + " test " +
                           DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
            this.message = config.Get[Configuration.Message];
        }
Exemplo n.º 14
0
        public BasePlayerShip(ShmupGameState gameState,IDriver<BasePlayerShip> driver)
            : base("Models/Ships/p1_saucer", gameState, driver)
        {
            _gameState = gameState;

            CollisionSpheres = new List<BoundingSphere>() { new BoundingSphere(new Vector3(), 700) };

             SpeedSide=100.0f;
             SpeedForward = 100.0f;
             SpeedBack = 100.0f;
            MaxBank=MathHelper.ToRadians(45);
            EnterBankTime = 20;
            ExitBankTime = 40;
        }
Exemplo n.º 15
0
 public SqlCommandProcessor(SqlMapperEngine engine)
 {
     this.engine = engine;
     if (engine.Driver.SupportDataManipulationLanguage)
     {
         driver = engine.Driver;
         dialect = engine.Dialect;
     }
     else
     {
         driver = engine.AlternateDriver;
         dialect = engine.AlternateDialect;
     }
     Connection = driver.CreateConnection();
 }
		protected override void OnSetUp()
		{
			driverClass = (string)cfg.Properties["hibernate.connection.driver_class"];
			if(driverClass.IndexOf(",") < 0) 
			{
				driverClass += ", NHibernate";
			}

			driver = (IDriver)Activator.CreateInstance(System.Type.GetType(driverClass));

			string prepare = (string)cfg.Properties[ Cfg.Environment.PrepareSql ] as string;
			if( prepare=="true" )
			{
				prepareSql = true;
			}
		}
Exemplo n.º 17
0
        /// <summary>
        /// Deletes the specified driver.
        /// </summary>
        /// <param name="driver">The driver</param>
        /// <exception cref="ArgumentNullException">NULL Driver passed into method</exception>
        /// <returns></returns>
        public OpResult Delete(IDriver driver)
        {
            OpResult result = OpResult.Success;

            if (driver == null)
                result = OpResult.NullParameter;

            if (result == OpResult.Success)
            {
                if (_drivers.Contains(driver))
                    _drivers.Remove(driver);
                else
                    result = OpResult.ObjectNotExists;
            }

            return result;
        }
Exemplo n.º 18
0
        public GmailTest(Configuration config, IDriver driver)
            : base(config, driver)
        {
            this.loginPage = new LoginPage(this.driver, config)
            {
                UsernameInput = new TextArea(driver) { Locator = By.Id("Email") },
                PasswordInput = new TextArea(driver) { Locator = By.Id("Passwd") },
                SignInButton = new Button(driver) { Locator = By.Id("signIn") },
                NextButton = new Button(driver) { Locator = By.Id("next") },
            };

            this.userName = config.Get[Configuration.UserName];
            this.password = config.Get[Configuration.Password];
            this.recipient = config.Get[Configuration.Recipient];
            this.subject = config.Get[Configuration.BrowserName] + " test " +
                           DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
            this.message = config.Get[Configuration.Message];
        }
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;

            var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml");
            config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType);

            //Use an IoC container and register as a Singleton
            var url = ConfigurationManager.AppSettings["GraphDBUrl"];
            var driver = GraphDatabase.Driver(url);

            Neo4jDriver = driver;
        }
Exemplo n.º 20
0
        public static void InitFromProperties(ILogger logger = null, IAssert assert = null,
            TimeoutSettings timeouts = null, IDriver<IWebDriver> driverFactory = null)
        {
            Init(logger, assert, timeouts, driverFactory);
            JDISettings.InitFromProperties();
            FillFromSettings(p => Domain = p, "Domain");
            FillFromSettings(p => DriverFactory.DriverPath = p, "DriversFolder");

            // FillFromSettings(p => DriverFactory.DriverVersion = p, "DriversVersion");
            // fillAction(p->getDriverFactory().getLatestDriver =
            //        p.toLowerCase().equals("true") || p.toLowerCase().equals("1"), "driver.getLatest");
            // fillAction(p->asserter.doScreenshot(p), "screenshot.strategy");
            FillFromSettings(p =>
            {
                p = p.ToLower();
                if (p.Equals("soft"))
                    p = "any,multiple";
                if (p.Equals("strict"))
                    p = "visible,single";
                if (p.Split(',').Length != 2) return;
                var parameters = p.Split(',').ToList();
                if (parameters.Contains("visible") || parameters.Contains("displayed"))
                    WebDriverFactory.ElementSearchCriteria = el => el.Displayed;
                if (parameters.Contains("any") || parameters.Contains("all"))
                    WebDriverFactory.ElementSearchCriteria = el => el != null;
                if (parameters.Contains("single") || parameters.Contains("displayed"))
                    OnlyOneElementAllowedInSearch = true;
                if (parameters.Contains("multiple") || parameters.Contains("displayed"))
                    OnlyOneElementAllowedInSearch = false;
            }, "SearchElementStrategy");

            FillFromSettings(p =>
            {
                string[] split = null;
                if (p.Split(',').Length == 2)
                    split = p.Split(',');
                if (p.ToLower().Split('x').Length == 2)
                    split = p.ToLower().Split('x');
                if (split != null)
                    BrowserSize = new Size(Parse(split[0]), Parse(split[1]));
            }, "BrowserSize");
        }
		/// <summary>
		/// Configures the driver for the ConnectionProvider.
		/// </summary>
		/// <param name="settings">An <see cref="IDictionary"/> that contains the settings for the Driver.</param>
		/// <exception cref="HibernateException">
		/// Thrown when the <see cref="Environment.ConnectionDriver"/> could not be 
		/// found in the <c>settings</c> parameter or there is a problem with creating
		/// the <see cref="IDriver"/>.
		/// </exception>
		protected virtual void ConfigureDriver( IDictionary settings )
		{
			string driverClass = settings[ Environment.ConnectionDriver ] as string;
			if( driverClass == null )
			{
				throw new HibernateException( "The " + Environment.ConnectionDriver + " must be specified in the NHibernate configuration section." );
			}
			else
			{
				try
				{
					driver = ( IDriver ) Activator.CreateInstance( ReflectHelper.ClassForName( driverClass ) );
				}
				catch( Exception e )
				{
					throw new HibernateException( "Could not create the driver from " + driverClass + ".", e );
				}

			}
		}
Exemplo n.º 22
0
		public Car(IDriver driver, IEngine engine, IFuel fuel)
		{
			if (driver == null)
			{
				throw new ArgumentNullException("driver");
			}

			if (engine == null)
			{
				throw new ArgumentNullException("engine");
			}

			if (fuel == null)
			{
				throw new ArgumentNullException("fuel");
			}

			_driver = driver;
			_engine = engine;
			_fuel = fuel;
		}
Exemplo n.º 23
0
        public OpResult DeleteDriver(IDriver driver)
        {
            OpResult result = OpResult.Success;

            if (driver == null)
                result = OpResult.NullParameter;

            if (result == OpResult.Success)
            {
                try
                {
                    result = _dataProvider.Delete(driver);
                }
                catch (Exception ex)
                {
                    result = OpResult.ExceptionOccurred;
                    _logger.TraceException(ex.Message, ex);
                }
            }

            return result;
        }
Exemplo n.º 24
0
        public Vehicle(string filename, IDriver driver)
        {
            Driver = driver;
            Driver.Vehicle = this;

            Config = new VehicleFile(filename);

            if (driver is PlayerDriver)
            {
                if (Config.WindscreenMaterial != "none")
                    Config.Funks.Add(new WindscreenFunk(Config.WindscreenMaterial, this));
            }

            _model = new VehicleModel(Config, false);

            Audio = new VehicleAudio(this);

            Chassis = new VehicleChassis(this);

            CActor actor2 = _model.GetActor(Path.GetFileNameWithoutExtension(_model.ModelName));
            if (actor2 != null)
            {
                _deformableModel = (CDeformableModel)actor2.Model;
                _deformableModel._actor = Chassis.Actor;
                _deformableModel._carFile = Config;
            }

            _crushSection = Config.CrushSections[1];

            CMaterial crashMat = ResourceCache.GetMaterial(Config.CrashMaterialFiles[0]);
            _vehicleBitsEmitter = new ParticleEmitter(new VehicleBitsParticleSystem(crashMat), 3, Vector3.Zero);
            _vehicleBitsEmitter.DumpsPerSecond = 0.7f;

            DamageSmokeEmitter = new ParticleEmitter(new DamageSmokeParticleSystem(Color.Gray), 5, Vector3.Zero);
            DamageSmokeEmitter.Enabled = false;

            _flames = new PixmapBillboard(new Vector2(0.7f, 0.25f), "flames.pix");
            SkidMarkBuffer = new SkidMarkBuffer(this, 150);
        }
Exemplo n.º 25
0
        public virtual void Down(IDriver driver, ILogger logger, ISchemaInfo schemaInfo)
        {
            driver.BeforeDown(Version);

            var methods = GetDownMethods(migration.GetType(), driver);
            try
            {
                methods.ForEach(method => method.Invoke(migration, new[] { NewRunner(method, driver) }));
            }
            catch (ArgumentException)
            {
                throw new MigrationContractException("[Down] methods must take a single Runner parameter as an argument.", type);
            }
            catch (TargetInvocationException ex)
            {
                Console.Out.WriteLine(ex.InnerException.Message);
                throw ex.InnerException;
            }

            driver.AfterDown(Version);

            schemaInfo.DeleteSchemaVersion(Version, type.Assembly.GetName().Name);
        }
Exemplo n.º 26
0
        public Manager()
        {
            string type = ConfigurationManager.AppSettings["DRIVER"];
            if (null == type) throw new ManagerException("Default driver not set in config");

            Type driverType = Type.GetType(type, false);
            if (null == driverType) throw new ManagerException("Default driver type could not be loaded");

            this.driver = (Activator.CreateInstance(driverType) as IDriver);
            if (null == this.driver) throw new ManagerException("Default driver type specified in config is not an IDriver");

            this.driver.Watchdog = new Watchdog();
            string aztype = ConfigurationManager.AppSettings["AUTHORIZER"];
            if (null == aztype) throw new ManagerException("Authorizer not set in config");

            Type azType = Type.GetType(aztype, false);
            if (null == azType) throw new ManagerException("Authorizer type could not be loaded");

            this.authorizer = (Activator.CreateInstance(azType) as IAuthorizer);
            if (null == this.authorizer) throw new ManagerException("Authorizer specified in config is not an IAuthorizer");

            this.driver.StartUp();
        }
Exemplo n.º 27
0
        public void Init(IApi api, string dllpath)
        {
            _api = api;
            _dllpath = dllpath;
            IniParser _ini;
            try
            {
                _ini = new IniParser(_configPath);
            }
            catch (Exception ex)
            {
                throw new PlayerCheckException(String.Format("Error loading config: {0}", ex.Message));
            }

            _enabled = _ini.GetBoolSetting(Name, "Enabled");
            if (!_enabled)
                throw new PlayerCheckException(String.Format("{0} has been disabled", Name));

            _checkip = _ini.GetBoolSetting(Name, "CheckIP");
            _kickMessage = _ini.GetSetting(Name, "KickMessage");

            if (_ini.GetSetting(Name, "Mode") == "white")
            {
                _mode = Mode.Whitelist;
            }

            var settings = new DriverSettings()
            {
                Api = api,
                Ini = _ini,
                PluginPath = dllpath
            };

            _driver = Base.GetDriver(_ini);
            _driver.SetConfig(settings);
            api.OnBeMessageReceivedEvent += onBEMessageReceivedEvent;
        }
Exemplo n.º 28
0
 /// <summary>Create a new instance of the <see cref="WriteToGraphFunction"/>.</summary>
 /// <param name="driver">This is injected by the <see cref="Startup"/> class.</param>
 public WriteToGraphFunction(IDriver driver)
 {
     Driver = driver;
 }
Exemplo n.º 29
0
 public bool RemoveDriver(IDriver device)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 30
0
 public TestUser()
 {
     Driver = new WebManage().Start();
 }
Exemplo n.º 31
0
 public AsyncWrongCommandTxFunc(IDriver driver)
     : base(driver, false)
 {
 }
Exemplo n.º 32
0
 public Neo4j(string uri, string user, string password)
 {
     _driver = GraphDatabase.Driver(uri, AuthTokens.Basic(user, password));
 }
Exemplo n.º 33
0
 public Car(Guid id, IDriver driver, string license, bool hasTrumpSticker = false) : base(id, driver, license)
 {
     HasTrumpSticker = hasTrumpSticker;
 }
Exemplo n.º 34
0
 /// <summary>
 /// Инициализирует новый экземпляр класса <see cref="Printer"/>.
 /// </summary>
 /// <param name="name">Наименование принтера.</param>
 /// <param name="port">Порт, к которому привязан принтер.</param>
 /// <param name="driver">Драйвер, который связан с принтером.</param>
 /// <param name="processorName">Наименование процессора печати.</param>
 public Printer(string name, IPort port, IDriver driver, string processorName) : this(name, port?.Name, driver?.Name, processorName)
 {
 }
Exemplo n.º 35
0
 public RadioGroup(IDriver driver)
 {
     this.driver = driver;
 }
Exemplo n.º 36
0
 public AddTable(IDriver driver, IOperationRepository oprepos)
 {
     this.driver = driver;
     oprepository = oprepos;
     addTableOp = oprepository.NewInstance<IAddTableOperation>();
 }
Exemplo n.º 37
0
 public Page(IDriver driver)
 {
     Url    = "";
     Driver = driver;
     Wait   = new Wait(driver.Browser);
 }
Exemplo n.º 38
0
        private void ImportVars(IEditorApplication context, IBehavior behavior)
        {
            IVariableCollection variableCollection = context.Workspace.ActiveProject.VariableCollection;


            frmDescription frmSelection = new frmDescription();

            if (frmSelection.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                variableCollection = context.Workspace.ActiveProject.VariableCollection;

                //Displays all variable names in the zenon editor
                foreach (IVariable variable in variableCollection)
                {
                    context.DebugPrint("Variable name: " + variable.Name + " / Channel: " + variable.DataBlock, DebugPrintStyle.Standard);
                }

                IDataType myDatatype = context.Workspace.ActiveProject.DataTypeCollection["REAL"];

                // Treiber mappen
                IDriverCollection driverCollection = context.Workspace.ActiveProject.DriverCollection;

                if (driverCollection == null || driverCollection.Count < 1)
                {
                    return;
                }

                IDriver sel_driver = null;
                //Displays all available drivers in zenon
                foreach (IDriver driver in driverCollection)
                {
                    if (driver.Name == "S7TCP32")
                    {
                        sel_driver = driver;
                        context.DebugPrint("Driver ausgewäht = " + sel_driver.Name, DebugPrintStyle.Standard);
                    }
                }

                #region Numerisch
                //Einlesen von CSV für numerische Variablen
                List <GTINumVal> GTINumValues = new List <GTINumVal>();
                try
                {
                    context.DebugPrint("Einlesen von: " + frmSelection.file_numeric, DebugPrintStyle.Standard);
                    GTINumValues = ReadCSV(frmSelection.file_numeric);
                }
                catch (Exception creationException)
                {
                    context.DebugPrint("Reading CSV error: " + creationException.Message, DebugPrintStyle.Error);
                    return;
                }
                if (GTINumValues.Count < 1)
                {
                    context.DebugPrint("Reading CSV error", DebugPrintStyle.Error);
                    return;
                }

                foreach (GTINumVal tempVal in GTINumValues)
                {
                    string myVariableName = tempVal.Name;

                    // Jetzt werden die Variablen erstellt
                    if (variableCollection[myVariableName] == null)
                    {
                        try
                        {
                            switch (tempVal.GtiDatentyp)
                            {
                            case "LW":
                                myDatatype = context.Workspace.ActiveProject.DataTypeCollection["DINT"];
                                break;

                            case "FLOAT":
                                myDatatype = context.Workspace.ActiveProject.DataTypeCollection["REAL"];
                                break;

                            case "WORT":
                                myDatatype = context.Workspace.ActiveProject.DataTypeCollection["INT"];
                                break;

                            case "BCD-DL":
                                myDatatype = context.Workspace.ActiveProject.DataTypeCollection["INT"];
                                break;

                            case "S7-BYTE":
                                myDatatype = context.Workspace.ActiveProject.DataTypeCollection["USINT"];
                                break;

                            default:
                                myDatatype = context.Workspace.ActiveProject.DataTypeCollection["REAL"];
                                break;
                            }

                            variableCollection.Create(myVariableName, sel_driver, ChannelType.DriverVariable, myDatatype);

                            if (variableCollection[myVariableName] == null)
                            {
                                context.DebugPrint("Variable could not be created.", DebugPrintStyle.Error);
                                return;
                            }

                            variableCollection[myVariableName].DataBlock = tempVal.DataBlock;
                            variableCollection[myVariableName].Offset    = tempVal.Offset;
                            //variableCollection[myVariableName].Unit = "%";
                            variableCollection[myVariableName].SignalMaximumRange    = tempVal.MaxWert;
                            variableCollection[myVariableName].SignalMinimumRange    = tempVal.MinWert;
                            variableCollection[myVariableName].MeasuringMaximumRange = tempVal.MaxNorm;
                            variableCollection[myVariableName].MeasuringMinimumRange = tempVal.MinNorm;
                            variableCollection[myVariableName].Digits     = tempVal.Komma;
                            variableCollection[myVariableName].NetAddress = tempVal.Netzadresse;
                        }
                        catch (Exception creationException)
                        {
                            context.DebugPrint("Variable creation error: " + creationException.Message, DebugPrintStyle.Error);
                        }
                        context.DebugPrint("Variable " + variableCollection[myVariableName].Name + " has been created.", DebugPrintStyle.Standard);
                    }
                    else
                    {
                        context.DebugPrint("The variable " + variableCollection[myVariableName].Name + " exists already!", DebugPrintStyle.Warning);
                    }
                }
                #endregion

                #region Logisch
                //Einlesen von CSV für numerische Variablen
                List <GTILogVal> GTILogValues = new List <GTILogVal>();
                try
                {
                    context.DebugPrint("Einlesen von: " + frmSelection.file_logic, DebugPrintStyle.Standard);
                    GTILogValues = ReadLogCSV(frmSelection.file_logic);
                }
                catch (Exception creationException)
                {
                    context.DebugPrint("Reading CSV error: " + creationException.Message, DebugPrintStyle.Error);
                    return;
                }
                if (GTINumValues.Count < 1)
                {
                    context.DebugPrint("Reading CSV error", DebugPrintStyle.Error);
                    return;
                }

                foreach (GTILogVal tempVal in GTILogValues)
                {
                    string myVariableName = tempVal.Name;

                    // Jetzt werden die Variablen erstellt
                    if (variableCollection[myVariableName] == null)
                    {
                        try
                        {
                            myDatatype = context.Workspace.ActiveProject.DataTypeCollection["BOOL"];
                            variableCollection.Create(myVariableName, sel_driver, ChannelType.DriverVariable, myDatatype);

                            if (variableCollection[myVariableName] == null)
                            {
                                context.DebugPrint("Variable could not be created.", DebugPrintStyle.Error);
                                return;
                            }

                            variableCollection[myVariableName].DataBlock  = tempVal.DataBlock;
                            variableCollection[myVariableName].Offset     = tempVal.Offset;
                            variableCollection[myVariableName].BitNumber  = tempVal.Bit;
                            variableCollection[myVariableName].NetAddress = tempVal.Netzadresse;
                        }
                        catch (Exception creationException)
                        {
                            context.DebugPrint("Variable creation error: " + creationException.Message, DebugPrintStyle.Error);
                        }
                        context.DebugPrint("Variable " + variableCollection[myVariableName].Name + " has been created.", DebugPrintStyle.Standard);
                    }
                    else
                    {
                        context.DebugPrint("The variable " + variableCollection[myVariableName].Name + " exists already!", DebugPrintStyle.Warning);
                    }
                }
                #endregion

                #region Limits

                //Einlesen von CSV für numerische Variablen
                List <GTIAlert> GTIAlerts = new List <GTIAlert>();
                GTIAlerts = ReadAlertCSV(frmSelection.file_alert);

                context.DebugPrint("Number: " + GTIAlerts.Count(), DebugPrintStyle.Standard);

                foreach (GTIAlert alert in GTIAlerts)
                {
                    context.DebugPrint("Alert: " + alert.Number + " / Name: " + alert.AlarmText + " / Variable: " + alert.Variable, DebugPrintStyle.Standard);
                }

                if (variableCollection == null || variableCollection.Count < 1)
                {
                    return;
                }

                //Alle Variablen als "False" setzten
                foreach (IVariable variable in variableCollection)
                {
                    for (int i = 0; i < variable.EditorLimitValueCount; i++)
                    {
                        variable.DeleteEditorLimitValue(i);
                    }

                    if (GTIAlerts.Where(x => x.Variable == variable.Name).Count() > 0)
                    {
                        variable.CreateEditorLimitValue();
                        IEditorLimitValue limit = variable.GetEditorLimitValue(0);
                        limit.IsActive = true;
                        limit.Text     = GTIAlerts.Where(x => x.Variable == variable.Name).FirstOrDefault().AlarmText;
                    }
                }

                #endregion
            }
        }
Exemplo n.º 39
0
 public Neo4JHelper()
 {
     _driver = GraphDatabase.Driver(uri, AuthTokens.Basic(user, password));
 }
 public Car(IDriver driver)
 {
     ///
 }
Exemplo n.º 41
0
 public Story(string id, IDriver driver)
 {
     _id     = id;
     _driver = driver;
 }
Exemplo n.º 42
0
 internal Hover(DriverScope driverScope,
                IDriver driver,
                Options options) : base(driver, driverScope, options)
 {
     _driverScope = driverScope;
 }
Exemplo n.º 43
0
 /// <summary>
 /// Инициализирует новый экземпляр класса <see cref="Printer"/>.
 /// </summary>
 /// <param name="name">Наименование принтера.</param>
 /// <param name="port">Порт, к которому привязан принтер.</param>
 /// <param name="driver">Драйвер, который связан с принтером.</param>
 /// <param name="processorName">Наименование процессора печати.</param>
 /// <param name="shareName">Публичное наименование принтера.</param>
 /// <param name="serverName">Имя сервера.</param>
 /// <param name="description">Описание принтера.</param>
 public Printer(string name, IPort port, IDriver driver, string processorName, string shareName, string serverName, string description)
     : this(name, port?.Name, driver?.Name, processorName, shareName, serverName, description)
 {
 }
 public RxWriteCommand(StressTest <TContext> test, IDriver driver, bool useBookmark)
     : base(driver, useBookmark)
 {
     _test = test ?? throw new ArgumentNullException(nameof(test));
 }
Exemplo n.º 45
0
 public KanbanBoard(IDriver driver)
 {
     _driver = driver;
 }
Exemplo n.º 46
0
 /// <summary>
 /// Initialize new instance of ElFinder.Connector
 /// </summary>
 /// <param name="driver">Driver to process request</param>
 public Connector(IDriver driver)
 {
     _driver = driver;
 }
Exemplo n.º 47
0
 public AsyncWriteCommandUsingReadSessionInTx(IDriver driver, bool useBookmark)
     : base(driver, useBookmark)
 {
 }
Exemplo n.º 48
0
 public ReadDatabase(IDriver driver)
 {
     _driver = driver;
 }
Exemplo n.º 49
0
 public WeatherForecastController(ILogger <WeatherForecastController> logger, IDriver driver)
 {
     _logger = logger;
     _driver = driver;
 }
Exemplo n.º 50
0
 public MediaScanner()
 {
     driver = DriverFactory.MakeDriver("bolt://localhost:7687");
 }
Exemplo n.º 51
0
 public BlockingFailingCommand(IDriver driver)
     : base(driver, false)
 {
 }
Exemplo n.º 52
0
 /// <summary>
 /// Инициализирует новый экземпляр класса <see cref="Printer"/>.
 /// </summary>
 /// <param name="name">Наименование принтера.</param>
 /// <param name="port">Порт, к которому привязан принтер.</param>
 /// <param name="driver">Драйвер, который связан с принтером.</param>
 /// <param name="processorName">Наименование процессора печати.</param>
 /// <param name="shareName">Публичное наименование принтера.</param>
 /// <param name="serverName">Имя сервера.</param>
 /// <param name="description">Описание принтера.</param>
 /// <param name="dataType">Тип данных печати.</param>
 /// <param name="location">Местоположение принтера.</param>
 /// <param name="parameters">Параметры принтера.</param>
 public Printer(string name, IPort port, IDriver driver, string processorName, string shareName, string serverName, string description, DataType dataType,
                string location, string parameters)
     : this(name, port?.Name, driver?.Name, processorName, shareName, serverName, description, dataType, location, parameters)
 {
 }
 public RxReadCommandInTx(IDriver driver, bool useBookmark)
     : base(driver, useBookmark)
 {
 }
Exemplo n.º 54
0
 /// <summary>
 /// Инициализирует новый экземпляр класса <see cref="Printer"/>.
 /// </summary>
 /// <param name="name">Наименование принтера.</param>
 /// <param name="port">Порт, к которому привязан принтер.</param>
 /// <param name="driver">Драйвер, который связан с принтером.</param>
 public Printer(string name, IPort port, IDriver driver) : this(name, port?.Name, driver?.Name)
 {
 }
Exemplo n.º 55
0
 public EmailsListPage(IDriver driver) : base(driver)
 {
 }
Exemplo n.º 56
0
 public RecomendationController(IDriver neoDriver)
 {
     this.neoDriver = neoDriver;
 }
Exemplo n.º 57
0
 public FieldExtractionVisitor(IDriver driver)
 {
     Fields = new List<Field>();
     this.driver = driver;
 }
 private static IRxSession NewSession(IDriver driver)
 {
     return(driver.RxSession(o =>
                             o.WithDefaultAccessMode(AccessMode.Write).WithBookmarks(Bookmark.From("1", "3"))));
 }
Exemplo n.º 59
0
 public Page(string url, IDriver driver)
 {
     Url    = url;
     Driver = driver;
     Wait   = new Wait(driver.Browser);
 }
Exemplo n.º 60
0
 public ClientDriverWithParamsStats()
 {
     _driverImplementation = (IDriver)Cfg.Environment.BytecodeProvider.ObjectsFactory.CreateInstance(DriverClass);
 }