public void Load(HomeSimCockpitSDK.ILog log) { _log = log; // wczytanie konfiguracji LoadConfiguration(); }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; // wczytanie konfiguracji _configuration = DataViaNetwork.Configuration.Load(ConfigurationFilePath); }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; // wczytanie konfiguracji _configuration = ModulesConfiguration.Load(); }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; // wczytanie konfiguracji _configuration = ModulesConfiguration.Load(); _inputs = _configuration.InputVariables; }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; LoadConfig(); // wczytanie konfiguracji //_configuration = OC.Configuration.Load(ConfigurationFilePath); }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; // wczytanie konfiguracji _configuration = ModulesConfiguration.Load(); List <OutputVariable> outs = new List <OutputVariable>(); outs.AddRange(_configuration.OutputVariables); outs.Add(_flush); outs.Add(_autoFlush); _outputs = outs.ToArray(); }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; _timers = new Timer[50]; for (int i = 0; i < _timers.Length; i++) { _timers[i] = new Timer(this, i); } _functions = new HomeSimCockpitSDK.ModuleFunctionInfo[] { new HomeSimCockpitSDK.ModuleFunctionInfo("SetTimer", "Funkcja konfiguruje zdarzenie czasowe, argumenty: identyfikator timer'a, interwał (w ms), ilość zdarzeń (< 1 - nieskończenie wiele), przykład: SetTimer(\"timer_00\", 500, 100) - 100 zdarzeń co pół sekundy (500ms).", 3, new HomeSimCockpitSDK.ModuleExportedFunctionDelegate(_SetTimer)) , new HomeSimCockpitSDK.ModuleFunctionInfo("StartTimer", "Uruchamia wskazany timer, np. StartTimer(\"timer_01\").", 1, new HomeSimCockpitSDK.ModuleExportedFunctionDelegate(_StartTimer)) , new HomeSimCockpitSDK.ModuleFunctionInfo("StopTimer", "Zatrzymuje wskazany timer, np. StopTimer(\"timer_01\").", 1, new HomeSimCockpitSDK.ModuleExportedFunctionDelegate(_StopTimer)) }; }
public void Load(HomeSimCockpitSDK.ILog log) { // int size = Marshal.SizeOf(typeof(PMDG.PMDG_NGX_Data)); // log.Log(this, size.ToString()); _log = log; // wczytanie konfiguracji //_configuration = Configuration.Load(Path.ChangeExtension(Assembly.GetExecutingAssembly().Location, ".xml"), this); // przypisanie zmiennych //_variables = _configuration.Inputs; _variables = new PMDGVariable[] { new PMDGMCPLights(), new PMDGMCPCourse(0), new PMDGMCPCourse(1), new PMDGMCPIAS(), new PMDGMCPHDG(), new PMDGMCPALT(), new PMDGMCPVS(), }; }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; }
public void Load(HomeSimCockpitSDK.ILog log) { _log = log; LoadConfiguration(); }
public TestDialog(XMLConfiguration configuration, HomeSimCockpitSDK.ILog log, HomeSimCockpitSDK.IModule module) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); _configuration = configuration; // pokazanie urządzeń foreach (RS232Configuration d in _configuration.Interfaces) { ListViewItem item = new ListViewItem(d.PortName); item.SubItems.Add(""); item.Tag = d; listView1.Items.Add(item); } // pokazanie wyświetlaczy for (int i = 0; i < _configuration.LCDs.Length; i++) { int r = dataGridView5.Rows.Add(_configuration.LCDs[i].ID, _configuration.LCDs[i].Description, "On", "Clear", "Off"); dataGridView5.Rows[r].Tag = _configuration.LCDs[i]; } // pokazanie obszarów tekstowych for (int i = 0; i < _configuration.Areas.Length; i++) { int r = dataGridView1.Rows.Add(_configuration.Areas[i].ID, _configuration.Areas[i].Description, ""); dataGridView1.Rows[r].Tag = _configuration.Areas[i]; } // pokazanie diod LED for (int i = 0; i < _configuration.LEDs.Length; i++) { int r = dataGridView2.Rows.Add(_configuration.LEDs[i].ID, _configuration.LEDs[i].Description, false); dataGridView2.Rows[r].Tag = _configuration.LEDs[i]; } // pokazanie grup diod LED for (int i = 0; i < _configuration.LEDGroups.Length; i++) { int r = dataGridView2.Rows.Add(_configuration.LEDGroups[i].ID, _configuration.LEDGroups[i].Description, false); dataGridView2.Rows[r].Tag = _configuration.LEDGroups[i]; } // pokazanie wyświetlaczy LED for (int i = 0; i < _configuration.LEDDisplays.Length; i++) { int r = dataGridView3.Rows.Add(_configuration.LEDDisplays[i].ID, _configuration.LEDDisplays[i].Description, ""); dataGridView3.Rows[r].Tag = _configuration.LEDDisplays[i]; } // pokazanie grup wyświetlaczy LED for (int i = 0; i < _configuration.LEDDisplayGroups.Length; i++) { int r = dataGridView3.Rows.Add(_configuration.LEDDisplayGroups[i].ID, _configuration.LEDDisplayGroups[i].Description, ""); dataGridView3.Rows[r].Tag = _configuration.LEDDisplayGroups[i]; } // pokazanie wejść cyfrowych for (int i = 0; i < _configuration.Keys.Length; i++) { int r = inputsGrid.Rows.Add(_configuration.Keys[i].ID, _configuration.Keys[i].Description, "False"); inputsGrid.Rows[r].Tag = _configuration.Keys[i]; } // pokazanie silników krokowych for (int i = 0; i < _configuration.StepperDevices.Length; i++) { if (_configuration.StepperDevices[i].Motor1 != null) { int r = dataGridView4.Rows.Add(_configuration.StepperDevices[i].Motor1.Id, _configuration.StepperDevices[i].Motor1.Description, _configuration.StepperDevices[i].Motor1.CurrentPosition); dataGridView4.Rows[r].Tag = _configuration.StepperDevices[i].Motor1; } if (_configuration.StepperDevices[i].Motor2 != null) { int r = dataGridView4.Rows.Add(_configuration.StepperDevices[i].Motor2.Id, _configuration.StepperDevices[i].Motor2.Description, _configuration.StepperDevices[i].Motor2.CurrentPosition); dataGridView4.Rows[r].Tag = _configuration.StepperDevices[i].Motor2; } } // pokazanie serwomechanizmów for (int i = 0; i < _configuration.ServoDevices.Length; i++) { for (int j = 0; j < _configuration.ServoDevices[i].Servos.Length; j++) { int r = gridServos.Rows.Add(_configuration.ServoDevices[i].Servos[j].Id, _configuration.ServoDevices[i].Servos[j].Description, _configuration.ServoDevices[i].Servos[j].Min, _configuration.ServoDevices[i].Servos[j].InitialPosition, _configuration.ServoDevices[i].Servos[j].Max); gridServos.Rows[r].Tag = _configuration.ServoDevices[i].Servos[j]; } } timer1.Enabled = dataGridView4.Rows.Count > 0; // pokazanie dodatkowych zmiennych IOutputVariable [] addins = _configuration.GetAddinsVariable(); if (addins != null && addins.Length > 0) { Array.Sort <IOutputVariable>(addins, delegate(IOutputVariable left, IOutputVariable right) { int result = left.ID.CompareTo(right.ID); if (result == 0) { result = left.Description.CompareTo(right.Description); } return(result); }); } for (int i = 0; i < addins.Length; i++) { int r = addinsGrid.Rows.Add(addins[i].ID, addins[i].Description, ""); addinsGrid.Rows[r].Tag = addins[i]; } Working = false; _log = log; _module = module; }
public ConfigurationDialog(XMLConfiguration xmlConfiguration, HomeSimCockpitSDK.ILog log, HomeSimCockpitSDK.IModule module) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); Configuration = xmlConfiguration; _root = treeView1.Nodes[0]; // pokazanie interfejsów i urządzeń Array.Sort <RS232Configuration>(xmlConfiguration.Interfaces); Array.Sort <LEDDevice>(xmlConfiguration.LEDDevices); Array.Sort <LCDDevice>(xmlConfiguration.LCDDevices); Array.Sort <LEDDisplayDevice>(xmlConfiguration.LEDDisplayDevices); Array.Sort <KeysDevice>(xmlConfiguration.KeysDevices); Array.Sort <Steppers.StepperDevice>(xmlConfiguration.StepperDevices); Array.Sort <Servos.ServoDevice>(xmlConfiguration.ServoDevices); for (int i = 0; i < xmlConfiguration.Interfaces.Length; i++) { InterfaceTreeNode node = new InterfaceTreeNode(xmlConfiguration.Interfaces[i]); _root.Nodes.Add(node); // dodanie wszystkich LCDDevice podpiętych do tego interfejsu for (int j = 0; j < xmlConfiguration.LCDDevices.Length; j++) { if (xmlConfiguration.LCDDevices[j].Interface == xmlConfiguration.Interfaces[i]) { TreeNode n = new TreeNode(xmlConfiguration.LCDDevices[j].Name2); n.Tag = xmlConfiguration.LCDDevices[j]; node.Nodes.Add(n); } } // dodanie wszystkich LEDDevice podpiętych do tego interfejsu for (int j = 0; j < xmlConfiguration.LEDDevices.Length; j++) { if (xmlConfiguration.LEDDevices[j].Interface == xmlConfiguration.Interfaces[i]) { TreeNode n = new TreeNode(xmlConfiguration.LEDDevices[j].Name2); n.Tag = xmlConfiguration.LEDDevices[j]; node.Nodes.Add(n); } } // dodanie wszystkich LEDDisplayDevice podpiętych do tego interfejsu for (int j = 0; j < xmlConfiguration.LEDDisplayDevices.Length; j++) { if (xmlConfiguration.LEDDisplayDevices[j].Interface == xmlConfiguration.Interfaces[i]) { TreeNode n = new TreeNode(xmlConfiguration.LEDDisplayDevices[j].Name2); n.Tag = xmlConfiguration.LEDDisplayDevices[j]; node.Nodes.Add(n); } } // dodanie wszystkich StepperDevice podpiętych do tego interfejsu for (int j = 0; j < xmlConfiguration.StepperDevices.Length; j++) { if (xmlConfiguration.StepperDevices[j].Interface == xmlConfiguration.Interfaces[i]) { TreeNode n = new TreeNode(xmlConfiguration.StepperDevices[j].Name2); n.Tag = xmlConfiguration.StepperDevices[j]; node.Nodes.Add(n); } } // dodanie wszystkich ServoDevice podpiętych do tego interfejsu for (int j = 0; j < xmlConfiguration.ServoDevices.Length; j++) { if (xmlConfiguration.ServoDevices[j].Interface == xmlConfiguration.Interfaces[i]) { TreeNode n = new TreeNode(xmlConfiguration.ServoDevices[j].Name2); n.Tag = xmlConfiguration.ServoDevices[j]; node.Nodes.Add(n); } } // dodanie wszystkich KeysDevice podpiętych do tego interfejsu for (int j = 0; j < xmlConfiguration.KeysDevices.Length; j++) { if (xmlConfiguration.KeysDevices[j].Interface == xmlConfiguration.Interfaces[i]) { TreeNode n = new TreeNode(xmlConfiguration.KeysDevices[j].Name2); n.Tag = xmlConfiguration.KeysDevices[j]; node.Nodes.Add(n); } } } treeView1.ExpandAll(); treeView1.SelectedNode = _root; ShowVariables(); _log = log; _module = module; }