Ejemplo n.º 1
0
void ParamEdit::TransferToWindow(DefinedParam *param) {
	DrawsSets *ds = m_cfg_mgr->GetConfigByPrefix(param->GetBasePrefix());

	m_button_base_config->SetLabel(ds->GetID());
	m_prec_spin->SetValue(param->GetPrec());
 	m_formula_input->SetText(param->GetFormula());
	m_user_param_label->SetLabel(param->GetParamName().BeforeLast(L':') + L':');
	m_param_name_input->SetValue(param->GetParamName().AfterLast(L':'));
	m_unit_input->SetValue(param->GetUnit());
	m_formula_type_choice->SetSelection(param->GetFormulaType() == TParam::LUA_VA ? 0 : 1);
	
	
	if (param->GetStartTime() > 0) {
		struct tm *start_date;
		time_t tmp_time = param->GetStartTime();
		start_date = localtime(&tmp_time);
	
		m_spin_ctrl_start_minutes->SetValue(start_date->tm_min);
		m_spin_ctrl_start_hours->SetValue(start_date->tm_hour);
	
		m_datepicker_ctrl_start_date->SetValue(wxDateTime(param->GetStartTime()));
		m_checkbox_start->SetValue(true);
		
		m_datepicker_ctrl_start_date->Enable(true);
		m_spin_ctrl_start_hours->Enable(true);
		m_spin_ctrl_start_minutes->Enable(true);
	}

}
Ejemplo n.º 2
0
void ParamEdit::OnFormulaInsertParam(wxCommandEvent &event) {

	DrawsSets* drawsets = m_cfg_mgr->GetConfigByPrefix(m_base_prefix);
	assert(drawsets);
	wxString ct = drawsets->GetID();

	if (m_inc_search == NULL)
		m_inc_search = new IncSearch(m_cfg_mgr, m_remarks_handler, ct, this, -1, _("Find"), false, false);
	else
		m_inc_search->SetConfigName(ct);
	

	if (m_inc_search->ShowModal() != wxID_OK)
		return;

	long prev = -1;
	DrawInfo *draw;
	while ((draw = m_inc_search->GetDrawInfo(&prev)) != NULL) {
		DrawParam *p = draw->GetParam();
		wxString pname = p->GetParamName();
		m_formula_input->AddText(wxString::Format(_T("p(\"%s:%s\", t, pt) "), draw->GetBasePrefix().c_str(), pname.c_str()));
	}

}
Ejemplo n.º 3
0
void FrameManager::ShowStatDialog(wxString prefix, TimeInfo time, DrawInfoList user_draws) {
	DrawsSets* config = config_manager->GetConfigByPrefix(prefix);
	new StatDialog(NULL, config->GetID(), database_manager, config_manager, remarks_handler, time, user_draws);
}
Ejemplo n.º 4
0
void FrameManager::CreateXYZGraph(wxString prefix, TimeInfo time, DrawInfoList user_draws) {
	DrawsSets* config = config_manager->GetConfigByPrefix(prefix);
	new XYZFrame(config->GetID(), database_manager, config_manager, remarks_handler, time, user_draws, this);
}