public NumericPanelForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); n_panel = new NumericPanel(_app); }
public TechDataForm() { InitializeComponent(); mutex = new Mutex(); _app = SgtApplication.CreateInstance(); }
public SourceDiameterPumpForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); seter = new setter(seterF); }
/// <summary> /// пробуем отсоединиться и соединиться /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void accept_Click(object sender, EventArgs e) { Uri last = DevManClient.Uri; try { if (textBoxTotalAddress.Text != string.Empty) { if (last.OriginalString != textBoxTotalAddress.Text) { Uri newUri = null; try { newUri = new Uri(textBoxTotalAddress.Text); SgtApplication _app = SgtApplication.CreateInstance(); if (_app != null) { _app.Commutator.DevManUri = newUri; } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ParameterCheckerForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); SetExStyles(); }
public EditNumericPanelForm(NumericPanel edited) { InitializeComponent(); _app = SgtApplication.CreateInstance(); if (edited != null) { n_panel = edited; copy_panelName = n_panel.VPanelName; copy_items = new List <VPanelParameter>(); foreach (VPanelParameter par in n_panel.Items) { copy_items.Add(par); } copy_gr1 = new VPanelGraphic(); copy_gr2 = new VPanelGraphic(); copy_gr3 = new VPanelGraphic(); copy_gr4 = new VPanelGraphic(); copy_gr5 = new VPanelGraphic(); copy_graphic(n_panel.Graphic_1, copy_gr1); copy_graphic(n_panel.Graphic_2, copy_gr2); copy_graphic(n_panel.Graphic_3, copy_gr3); copy_graphic(n_panel.Graphic_4, copy_gr4); copy_graphic(n_panel.Graphic_5, copy_gr5); } else { n_panel = new NumericPanel(_app); } }
public GasSensorsForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); for (int i = 0; i < 10; i++) { dataGridView1.Rows.Add(); } dataGridView1.Rows[0].Cells[0].Value = "Датчик 1"; dataGridView1.Rows[1].Cells[0].Value = "Датчик 2"; dataGridView1.Rows[2].Cells[0].Value = "Датчик 3"; dataGridView1.Rows[3].Cells[0].Value = "Датчик 4"; dataGridView1.Rows[4].Cells[0].Value = "Датчик 5"; dataGridView1.Rows[5].Cells[0].Value = "Датчик 6"; dataGridView1.Rows[6].Cells[0].Value = "Датчик 7"; dataGridView1.Rows[7].Cells[0].Value = "Датчик 8"; dataGridView1.Rows[8].Cells[0].Value = "Датчик 9"; dataGridView1.Rows[9].Cells[0].Value = "Датчик 10"; }
/// <summary> /// Актуализировать ссылки на параметры /// </summary> public void ActualizedParameters() { try { SgtApplication _app = SgtApplication.CreateInstance(); if (_app != null) { TParameter[] t_parames = Parameters; if (t_parames != null) { foreach (TParameter t_param in t_parames) { if (t_param != null) { Parameter p_param = _app.GetParameter(t_param.Identifier); if (p_param != null && p_param.Channel != null) { t_param.PNumber = p_param.Channel.Number; } } } } } } catch (Exception ex) { ErrorHandler.WriteToLog(this, new ErrorArgs(ex.Message, ErrorType.NotFatal)); } }
protected SgtApplication _app = null; // контекст работы программы public WorksForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); if (_app != null) { works = _app.Works; } }
/// <summary> /// инициализирует новый экземпляр класса /// </summary> public ParametersTunerForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); if (_app == null) { MessageBox.Show("Не удалось получить доступ к параметрам приложения"); } }
/// <summary> /// Получили данные от devMan /// </summary> /// <param name="sender">Источник события</param> /// <param name="e">Параметры события</param> protected void DevManClient_onReceive(object sender, ReceivedEventArgs e) { try { DateTime now = DateTime.Now; TimeDatAacquisition = now; if (now > lastTime) { TimeSpan interval = now - lastTime; if (interval.Ticks > tInterval.Ticks) { lastTime = now; foreach (Parameter parameter in parameters) { PDescription channel = parameter.Channel; if (channel != null) { if (channel.Number >= 0 && channel.Number < e.Slice.Length) { CommutatorParameter.setCurrent(parameter, e.Slice[channel.Number]); e.Slice[channel.Number] = parameter.CalculatedValue; } } } SgtApplication app = SgtApplication.CreateInstance(); if (app != null) { app.Technology.Calculate(this, new CommutatorEventArgs(e.Slice)); if (tech_saver != null) { tech_saver(e.Slice); } } buffer.Append(new Slice(DateTime.Now, e.Slice)); UpdateTechnologyParameters(); if (onUpdated != null) { onUpdated(this, new CommutatorEventArgs(e.Slice)); } } } else { lastTime = now; } } catch (Exception ex) { ErrorHandler.WriteToLog(sender, new ErrorArgs(ex.Message, ErrorType.NotFatal)); } }
protected long initialized = 0; // инициализирована панель или нет /// <summary> /// Инициализирует новый экземпляр класса /// </summary> public FullPanel() : base("Общая панель", VPanelType.FullPanel) { g_panel_1 = new GraphicPanel(); g_panel_2 = new GraphicPanel(); g_panel_3 = new GraphicPanel(); items = new List <VPanelParameter>(); _app = SgtApplication.CreateInstance(); _app.Technology.onComplete += new EventHandler(Technology_onComplete); }
public PumpMovesForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); if (_app == null) { MessageBox.Show(this, "Не удалось инициализировать настройки", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } }
public DrillingShaftForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); if (_app != null) { } else { MessageBox.Show(this, "Во время загрузки возникла ошибка", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } }
public IdealRashodForm(TParameter parameter) { InitializeComponent(); if (parameter is P0109) { p109 = parameter as P0109; } else { p112 = parameter as P0112; } _app = SgtApplication.CreateInstance(); listView1.ListViewItemSorter = new ListComparer(); }
/// <summary> /// проверяем /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void accept_Click(object sender, EventArgs e) { SgtApplication _app = SgtApplication.CreateInstance(); if (_app != null) { if (textBoxPassword.Text == _app.DB_Manager.Password) { MessageBox.Show(this, "Система переведена в режим настройки.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); _app.GuiMode = GuiMode.Techolog; } else { MessageBox.Show(this, "Система переведена в режим пользователя.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); //MessageBox.Show(this, "Введен неверный пароль. Система переведена в режим пользователя.", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); _app.GuiMode = GuiMode.User; //DialogResult = DialogResult.None; } } }
static void Main() { try { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler); mutex = new Mutex(true, identifier, out isNotRunning); if (isNotRunning) { app = SgtApplication.CreateInstance(); if (app != null) { app.Load(); app.Commutator.DeSerialize(); app.Connect(); System.Windows.Forms.Application.ApplicationExit += new EventHandler(Application_ApplicationExit); System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); System.Windows.Forms.Application.Run(new mainForm()); } } else { MessageBox.Show("Приложение уже запущено", "Информация", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { ErrorHandler.WriteToLog(null, new ErrorArgs(ex.Message, ErrorType.Unknown)); } }
public DrillingPanelForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public CommandP0105Form() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public DBOptionsForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public DriveParametersForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public TalblockForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public DockedVolumeForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public AsyCommandTunerForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
/// <summary> /// Передать технологически параметры серверу данных /// </summary> protected void UpdateTechnologyParameters() { try { TParameter[] t_prms = SgtApplication.CreateInstance().Technology.Parameters; if (t_prms != null) { foreach (TParameter parameter in t_prms) { if (parameter != null && parameter.IsSimple == false) { int dev_number = NumberTechOnDev(parameter.SNumber); if (dev_number != -1) { DevManClient.UpdateParameter(dev_number, parameter.Value); } } else if (parameter != null && parameter.IsSimple == true) { switch (parameter.UnigueClassName) { case "P0014": try { P0014 par = parameter as P0014; if (par != null && par.Source == P0014Source.Own) { int dev_number = NumberTechOnDev(par.SNumber); if (dev_number != -1) { DevManClient.UpdateParameter(dev_number, parameter.Value); } } } catch { } break; case "P14_1": try { P14_1 par = parameter as P14_1; if (par != null && par.Source == P0014Source.Own) { int dev_number = NumberTechOnDev(par.SNumber); if (dev_number != -1) { DevManClient.UpdateParameter(dev_number, parameter.Value); } } } catch { } break; default: break; } } } } } catch (Exception ex) { ErrorHandler.WriteToLog(this, new ErrorArgs(ex.Message, ErrorType.NotFatal)); } }
public VolumeSolutionTanksForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public SelectParameterForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public WeightColumnForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public GasAlarmForm50() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }
public FlowInletForm() { InitializeComponent(); _app = SgtApplication.CreateInstance(); }