Пример #1
0
 bool operator==(const entry& other) const {
   return get_device_id() == other.get_device_id() &&
          get_event_time_stamp() == other.get_event_time_stamp() &&
          get_valid() == other.get_valid() &&
          get_lazy() == other.get_lazy() &&
          get_event() == other.get_event() &&
          get_event_type() == other.get_event_type() &&
          get_original_event() == other.get_original_event();
 }
Пример #2
0
bool ArrayVariableProperty::OnButtonClick(wxPropertyGrid* pg,
		wxWindow* WXUNUSED(primaryCtrl), const wxChar* cbt) {

	dataset_vars_ = get_dataset_vars();

	// Update the value from user entry
	wxVariant useValue = pg->GetUncommittedPropertyValue();
	project_vars_ = get_valid(useValue.GetArrayString());

	//if (!pg->EditorValidate()) return false;

	// Create editor dialog
	//VariablesEditorDialog* dlg = create_editor_dialog();
#if wxUSE_VALIDATORS
	wxValidator* validator = GetValidator();
	wxPGInDialogValidator dialogValidator;
#endif

	const wxString name = GetLabel();
	const wxString title = name + " Editor";
	const wxString default_dir = wxEmptyString;
	VariablesEditorDialog* dlg = new VariablesEditorDialog(
		pg, default_dir, wxID_ANY, title, dataset_vars_, project_vars_,
		wxDefaultPosition, wxDefaultSize);//, wxDEFAULT_DIALOG_STYLE);

    //dlg->SetDialogValue(useValue);
    //dlg->Create(pg, wxEmptyString, m_label);

	bool retVal;

	for (;;) {
		retVal = false;

		int res = dlg->ShowModal();

		if (res == wxID_OK && dlg->IsModified()) {
			wxVariant value = dlg->GetDialogValue();
			if (!value.IsNull()) {
				wxArrayString actualValue = value.GetArrayString();
				wxString tempStr;
				ConvertArrayToString(actualValue, &tempStr, m_delimiter);
			#if wxUSE_VALIDATORS
				if (dialogValidator.DoValidate(pg, validator, tempStr))
			#endif
				{
					SetValueInEvent(actualValue);
					retVal = true;
					break;
                }
			} else break;
		} else break;
	}

	delete dlg;

	return retVal;
}
Пример #3
0
 nlohmann::json to_json(void) const {
   return nlohmann::json({
       {"device_id", type_safe::get(get_device_id())},
       {"event_time_stamp", get_event_time_stamp()},
       {"valid", get_valid()},
       {"lazy", get_lazy()},
       {"event", get_event()},
       {"event_type", get_event_type()},
       {"original_event", get_original_event()},
   });
 }
Пример #4
0
void test_regex( std::ostream & f ){
	f << get_valid() << "\n"
			<< get_wiki() << "\n"
			<< get_parent_begin() << "\n"
			<< get_parent_end() << "\n"
			<< get_tag_begin() << "\n"
			<< get_tag_end() << "\n"
			<< get_allow_link() << "\n"
			<< get_allow_global() << "\n"
			<< get_table_key_begin() << "\n"
			<< get_table_end() << "\n"
			<< get_key_value() << "\n"
			<< get_allow_type() << "\n"
			<< std::endl;
}