当前位置: 首页>>代码示例>>C++>>正文


C++ sat_log_log函数代码示例

本文整理汇总了C++中sat_log_log函数的典型用法代码示例。如果您正苦于以下问题:C++ sat_log_log函数的具体用法?C++ sat_log_log怎么用?C++ sat_log_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sat_log_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sat_cfg_reset_bool

void
sat_cfg_reset_bool (sat_cfg_bool_e param)
{

    if (param < SAT_CFG_BOOL_NUM) {

        if (config == NULL) {
            sat_log_log (SAT_LOG_LEVEL_BUG,
                         _("%s: Module not initialised\n"),
                         __FUNCTION__);
        }
        else {
            g_key_file_remove_key (config,
                                   sat_cfg_bool[param].group,
                                   sat_cfg_bool[param].key,
                                   NULL);
        }

    }
    else {
        sat_log_log (SAT_LOG_LEVEL_BUG,
                     _("%s: Unknown BOOL param index (%d)\n"),
                     __FUNCTION__, param);
    }
}
开发者ID:brunovianna,项目名称:GPredict---OSC,代码行数:25,代码来源:sat-cfg.c

示例2: sat_cfg_set_bool

/**
 * Store a boolean configuration value.
 * @param param The parameter to store.
 * @param value The value of the parameter.
 *
 * This function stores a boolean configuration value in the configuration
 * table.
 */
void sat_cfg_set_bool(sat_cfg_bool_e param, gboolean value)
{
    if (param < SAT_CFG_BOOL_NUM)
    {
        if (config == NULL)
        {
            sat_log_log (SAT_LOG_LEVEL_ERROR,
                         _("%s: Module not initialised\n"),
                         __func__);
        }
        else
        {
            g_key_file_set_boolean (config,
                                    sat_cfg_bool[param].group,
                                    sat_cfg_bool[param].key,
                                    value);
        }
    }
    else
    {
        sat_log_log (SAT_LOG_LEVEL_ERROR,
                     _("%s: Unknown BOOL param index (%d)\n"),
                     __func__, param);
    }
}
开发者ID:daniestevez,项目名称:gpredict,代码行数:33,代码来源:sat-cfg.c

示例3: sat_cfg_set_str

/** \brief Store a str configuration value.
 */
void sat_cfg_set_str (sat_cfg_str_e param, const gchar *value)
{

    if (param < SAT_CFG_STR_NUM) {

        if (config == NULL) {
            sat_log_log (SAT_LOG_LEVEL_BUG,
                         _("%s: Module not initialised\n"),
                         __FUNCTION__);
        }
        else {
            if (value) {
                g_key_file_set_string (config,
                                       sat_cfg_str[param].group,
                                       sat_cfg_str[param].key,
                                       value);
            }
            else {
                /* remove key from config */
                g_key_file_remove_key (config,
                                       sat_cfg_str[param].group,
                                       sat_cfg_str[param].key,
                                       NULL);
            }
        }

    }
    else {
        sat_log_log (SAT_LOG_LEVEL_BUG,
                     _("%s: Unknown STR param index (%d)\n"),
                     __FUNCTION__, param);
    }
}
开发者ID:brunovianna,项目名称:GPredict---OSC,代码行数:35,代码来源:sat-cfg.c

示例4: mod_mgr_reload_sats

/** brief Reload satellites in all modules. */
void
mod_mgr_reload_sats    ()
{
    guint      num;
    guint      i;
    GtkSatModule *mod;

    
    if (!nbook) {
        sat_log_log (SAT_LOG_LEVEL_BUG,
                     _("%s: Attempt to reload sats but mod-mgr is NULL?"),
                     __FUNCTION__);
        return;
    }

    num = g_slist_length (modules);

    if (num == 0) {
        sat_log_log (SAT_LOG_LEVEL_MSG,
                     _("%s: No modules need to reload sats."),
                     __FUNCTION__);

        return;
    }

    /* for each module in the GSList execute sat_module_reload_sats() */
    for (i = 0; i < num; i++) {

        mod = GTK_SAT_MODULE (g_slist_nth_data (modules, i));
        
        gtk_sat_module_reload_sats (mod);

    }

}
开发者ID:alejoduque,项目名称:GPredict---OSC,代码行数:36,代码来源:mod-mgr.c

示例5: sat_cfg_reset_int

void sat_cfg_reset_int(sat_cfg_int_e param)
{
    if (param < SAT_CFG_INT_NUM)
    {
        if (config == NULL)
        {
            sat_log_log (SAT_LOG_LEVEL_ERROR,
                         _("%s: Module not initialised\n"),
                         __func__);
        }
        else
        {
            g_key_file_remove_key (config,
                                   sat_cfg_int[param].group,
                                   sat_cfg_int[param].key,
                                   NULL);
        }

    }
    else
    {
        sat_log_log (SAT_LOG_LEVEL_ERROR,
                     _("%s: Unknown INT param index (%d)\n"),
                     __func__, param);
    }
}
开发者ID:daniestevez,项目名称:gpredict,代码行数:26,代码来源:sat-cfg.c

示例6: menubar_new_mod_cb

/* Create new module */
static void menubar_new_mod_cb(GtkWidget * widget, gpointer data)
{
    gchar          *modnam = NULL;
    gchar          *modfile;
    gchar          *confdir;
    GtkWidget      *module = NULL;

    (void)widget;
    (void)data;

    sat_log_log(SAT_LOG_LEVEL_DEBUG,
                _("%s: Starting new module configurator..."), __func__);

    modnam = mod_cfg_new();

    if (modnam)
    {
        sat_log_log(SAT_LOG_LEVEL_DEBUG, _("%s: New module name is %s."),
                    __func__, modnam);

        confdir = get_modules_dir();
        modfile =
            g_strconcat(confdir, G_DIR_SEPARATOR_S, modnam, ".mod", NULL);
        g_free(confdir);

        /* create new module */
        module = gtk_sat_module_new(modfile);

        if (module == NULL)
        {
            GtkWidget      *dialog;

            dialog = gtk_message_dialog_new(GTK_WINDOW(app),
                                            GTK_DIALOG_MODAL |
                                            GTK_DIALOG_DESTROY_WITH_PARENT,
                                            GTK_MESSAGE_ERROR,
                                            GTK_BUTTONS_OK,
                                            _("Could not open %s. "
                                              "Please examine the log messages "
                                              "for details."), modnam);

            gtk_dialog_run(GTK_DIALOG(dialog));
            gtk_widget_destroy(dialog);
        }
        else
        {
            mod_mgr_add_module(module, TRUE);
        }

        g_free(modnam);
        g_free(modfile);
    }
    else
    {
        sat_log_log(SAT_LOG_LEVEL_DEBUG, _("%s: New module config cancelled."),
                    __func__);
    }
}
开发者ID:csete,项目名称:gpredict,代码行数:59,代码来源:menubar.c

示例7: mod_mgr_save_state

/** \brief Save state of module manager.
 *
 * This function saves the state of the module manager. Currently, this consists
 * of saving the list of open modules. If no modules are open, the function saves
 * a NULL-list, indication that the corresponding configuration key should be
 * removed.
 */
void
mod_mgr_save_state ()
{
    guint      num;
    guint      i;
    GtkWidget *module;
    gchar     *mods = NULL;
    gchar     *buff;

    
    if (!nbook) {
        sat_log_log (SAT_LOG_LEVEL_BUG,
                     _("%s: Attempt to save state but mod-mgr is NULL?"),
                     __FUNCTION__);
        return;
    }

    num = g_slist_length (modules);

    if (num == 0) {
        sat_log_log (SAT_LOG_LEVEL_MSG,
                     _("%s: No modules need to save state."),
                     __FUNCTION__);

        sat_cfg_set_str (SAT_CFG_STR_OPEN_MODULES, NULL);

        return;
    }

    for (i = 0; i < num; i++) {
        module = GTK_WIDGET (g_slist_nth_data (modules, i));
        
        /* save state of the module */
        mod_cfg_save (GTK_SAT_MODULE (module)->name, GTK_SAT_MODULE (module)->cfgdata);
        
        if (i == 0) {
            buff = g_strdup (GTK_SAT_MODULE (module)->name);
        }
        else {
            buff = g_strconcat (mods, ";", GTK_SAT_MODULE (module)->name, NULL);
            g_free (mods);
        }

        mods = g_strdup (buff);
        g_free (buff);

        sat_log_log (SAT_LOG_LEVEL_DEBUG, _("%s: Stored %s"),
                     __FUNCTION__, GTK_SAT_MODULE (module)->name);

    }

    sat_log_log (SAT_LOG_LEVEL_MSG, _("%s: Saved states for %d modules."),
                 __FUNCTION__, num);

    sat_cfg_set_str (SAT_CFG_STR_OPEN_MODULES, mods);

    g_free (mods);
}
开发者ID:alejoduque,项目名称:GPredict---OSC,代码行数:65,代码来源:mod-mgr.c

示例8: ground_track_delete

/** \brief Delete the ground track for a satellite.
 *  \param satmap The satellite map widget.
 *  \param sat Pointer to the satellite object.
 *  \param qth Pointer to the QTH data.
 *  \param obj the satellite object.
 *  \param clear_ssp Flag indicating whether SSP data should be cleared as well (TRUE=yes);
 *
 */
void
ground_track_delete (GtkSatMap *satmap, sat_t *sat, qth_t *qth, sat_map_obj_t *obj, gboolean clear_ssp)
{
     guint              i,n;
     gint               j;
     GooCanvasItemModel *line;
     GooCanvasItemModel *root;

    (void) qth; /* avoid unusued parameter compiler warning */

    sat_log_log (SAT_LOG_LEVEL_DEBUG,
                     _("%s: Deleting ground track for %s"),
                 __FUNCTION__, sat->nickname);

     root = goo_canvas_get_root_item_model (GOO_CANVAS (satmap->canvas));

     /* remove plylines */
     if (obj->track_data.lines != NULL) {
          n = g_slist_length (obj->track_data.lines);

          for (i = 0; i < n; i++) {

               /* get line */
               line = GOO_CANVAS_ITEM_MODEL (g_slist_nth_data (obj->track_data.lines, i));

               /* find its ID and remove it */
               j = goo_canvas_item_model_find_child (root, line);
               if (j == -1) {
                    sat_log_log (SAT_LOG_LEVEL_ERROR,
                                    _("%s: Could not find part %d of ground track"),
                                    __FUNCTION__, j);
               }
               else {
                    goo_canvas_item_model_remove_child (root, j);
               }
          }

          g_slist_free (obj->track_data.lines);
          obj->track_data.lines = NULL;
               
     }

     /* clear SSP too? */
     if (clear_ssp == TRUE) {
          if (obj->track_data.latlon != NULL) {

               /* free allocated ssp_t */
               g_slist_foreach (obj->track_data.latlon, free_ssp, NULL);

               /* free the SList itself */
               g_slist_free (obj->track_data.latlon);
               obj->track_data.latlon = NULL;

          }

          obj->track_orbit = 0;
     }
}
开发者ID:kopaniapawel,项目名称:gpredict-1,代码行数:66,代码来源:gtk-sat-map-ground-track.c

示例9: g_slist_append

/** \brief Add a new module to mod-mgr.
 *  \param module The GtkSatModule widget to add
 *  \param dock Flag indicating whether module should be docked or not.
 *
 * This function registers a new module in the mod-mgr. If the dock flag is true
 * the module is added to the mod-mgr notebook, otherwise it will be up to the
 * caller to create a proper container.
 *
 */
gint
mod_mgr_add_module     (GtkWidget *module, gboolean dock)
{
    gint       retcode = 0;
    gint       page;


    if (module) {

        /* add module to internal list */
        modules = g_slist_append (modules, module);

        if (dock) {
            /* add module to notebook if state = DOCKED */
            page = gtk_notebook_append_page (GTK_NOTEBOOK (nbook),
                                             module,
                                             gtk_label_new (GTK_SAT_MODULE (module)->name));

            /* allow nmodule to be dragged to different position */
            gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK(nbook), module, TRUE);

            gtk_notebook_set_current_page (GTK_NOTEBOOK (nbook), page);

            /* send message to logger */
            sat_log_log (SAT_LOG_LEVEL_MSG,
                         _("%s: Added %s to module manger (page %d)."),
                         __FUNCTION__, GTK_SAT_MODULE (module)->name, page);
        }
        else {
            /* send message to logger */
            sat_log_log (SAT_LOG_LEVEL_MSG,
                         _("%s: Added %s to module manger (NOT DOCKED)."),
                         __FUNCTION__, GTK_SAT_MODULE (module)->name);
        }
        retcode = 0;
    }
    else {
        sat_log_log (SAT_LOG_LEVEL_ERROR,
                     _("%s: Module %s seems to be NULL"),
                     __FUNCTION__, GTK_SAT_MODULE (module)->name);
        retcode = 1;
    }

    /* disable tabs if only one page in notebook */
    if ((gtk_notebook_get_n_pages (GTK_NOTEBOOK(nbook))) == 1) {
        gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nbook), FALSE);
    }
    else {
        gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nbook), TRUE);
    }

    update_window_title    ();

    return retcode;

}
开发者ID:alejoduque,项目名称:GPredict---OSC,代码行数:65,代码来源:mod-mgr.c

示例10: mod_mgr_remove_module

/** \brief Remove a module from the notebook.
 *  \param module The module that should be removed.
 *  \return 0 if the module has been removed or 1 if the requested module
 *          could not be found in the notebook.
 */
gint
mod_mgr_remove_module (GtkWidget *module)
{
    gint page;
    gint retcode = 0;


    /* remove from notebook */
    if (GTK_SAT_MODULE (module)->state == GTK_SAT_MOD_STATE_DOCKED) {
        /* get page number for this module */
        page = gtk_notebook_page_num (GTK_NOTEBOOK (nbook), module);

        if (page == -1) {
            /* this is some kind of bug (inconsistency between internal states) */
            sat_log_log (SAT_LOG_LEVEL_BUG,
                         _("%s: Could not find child in notebook. This may hurt..."),
                         __FUNCTION__);

            retcode = 1;
        }
        else {
            gtk_notebook_remove_page (GTK_NOTEBOOK (nbook), page);

            sat_log_log (SAT_LOG_LEVEL_MSG,
                         _("%s: Removed child from notebook page %d."),
                         __FUNCTION__, page);

            retcode = 0;
        }
    }

    /* remove from list */
    modules = g_slist_remove (modules, module);

    /* undocked modules will have to destroy themselves
       because of their parent window
    */


    /* disable tabs if only one page in notebook */
    if ((gtk_notebook_get_n_pages (GTK_NOTEBOOK(nbook))) == 1) {
        gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nbook), FALSE);
    }
    else {
        gtk_notebook_set_show_tabs (GTK_NOTEBOOK (nbook), TRUE);
    }

    /* update window title */
    update_window_title ();

    return retcode;
}
开发者ID:alejoduque,项目名称:GPredict---OSC,代码行数:57,代码来源:mod-mgr.c

示例11: delete_location_files

/**
 * Remove .qth files.
 *
 * This function is used to remove any existing .qth file
 * before storing the data from the QTH list.
 */
static void delete_location_files()
{
    GDir           *dir = NULL; /* directory handle */
    GError         *error = NULL;       /* error flag and info */
    gchar          *dirname;    /* directory name */
    const gchar    *filename;   /* file name */
    gchar          *buff;

    /* scan for .qth files in the user config directory and
       add the contents of each .qth file to the list store
     */
    dirname = get_user_conf_dir();
    dir = g_dir_open(dirname, 0, &error);

    if (dir)
    {
        while ((filename = g_dir_read_name(dir)))
        {
            if (g_str_has_suffix(filename, ".qth"))
            {
                buff = g_strconcat(dirname, G_DIR_SEPARATOR_S, filename, NULL);

                /* remove file */
                if (g_remove(buff))
                {
                    sat_log_log(SAT_LOG_LEVEL_ERROR,
                                _("%s:%d: Failed to remove %s"),
                                __FILE__, __LINE__, filename);
                }
                else
                {
                    sat_log_log(SAT_LOG_LEVEL_DEBUG,
                                _("%s:%d: Removed %s"),
                                __FILE__, __LINE__, filename);
                }

                g_free(buff);
            }
        }
    }
    else
    {
        sat_log_log(SAT_LOG_LEVEL_ERROR,
                    _("%s:%d: Failed to open user cfg dir (%s)"),
                    __FILE__, __LINE__, error->message);
        g_clear_error(&error);

    }

    g_free(dirname);
    g_dir_close(dir);
}
开发者ID:bastla,项目名称:gpredict,代码行数:58,代码来源:sat-pref-qth.c

示例12: default_toggled

/**
 * Handle toggle events on "Default" check box
 * @param cell The item that received the signal.
 * @param path_str Path string.
 * @param data Pointer to user data (list store).
 *
 * This function is called when the user clicks on "Default" check box
 * indicating that a new default location has been selected. If the
 * clicked check box has been un-checked the action is ignored, because
 * we need a default location. If the clicked check box has been checked,
 * the default flag of the checked QTH is set to TRUE, while the flag is
 * cleared for all the other QTH's.
 */
static void default_toggled(GtkCellRendererToggle * cell, gchar * path_str,
                            gpointer data)
{
    GtkTreeModel   *model = (GtkTreeModel *) data;
    GtkTreeIter     iter;
    GtkTreePath    *path = gtk_tree_path_new_from_string(path_str);
    gboolean        fixed;
    gchar          *defqth;

    /* block toggle signals while we mess with the check boxes */
    g_signal_handler_block(cell, handler_id);

    /* get toggled iter */
    gtk_tree_model_get_iter(model, &iter, path);
    gtk_tree_model_get(model, &iter, QTH_LIST_COL_DEF, &fixed, -1);

    if (fixed)
    {
        /* do nothing except sending a message */
        sat_log_log(SAT_LOG_LEVEL_INFO,
                    _("%s:%d: Default QTH can not be cleared! "
                      "Select another QTH to change default."),
                    __FILE__, __LINE__);
    }
    else
    {
        /* make this qth new default */
        gtk_list_store_set(GTK_LIST_STORE(model), &iter,
                           QTH_LIST_COL_DEF, TRUE, -1);

        /* copy file name of new default QTH to a string buffer */
        gtk_tree_model_get(model, &iter, QTH_LIST_COL_NAME, &defqth, -1);

        sat_log_log(SAT_LOG_LEVEL_INFO,
                    _("%s:%d: New default QTH is %s.qth."),
                    __FILE__, __LINE__, defqth);

        /* clear the default flag for the other qth */
        gtk_tree_model_foreach(model, clear_default_flags, defqth);

        g_free(defqth);

    }

    /* clean up */
    gtk_tree_path_free(path);

    /* unblock toggle signals */
    g_signal_handler_unblock(cell, handler_id);
}
开发者ID:bastla,项目名称:gpredict,代码行数:63,代码来源:sat-pref-qth.c

示例13: sat_cfg_close

/** \brief Load configuration data.
 *  \return 0 if everything OK, 1 otherwise.
 *
 * This function reads the configuration data from gpredict.cfg into
 * memory. This function must be called very early at program start.
 *
 * The the configuration data in memory is already "loaded" the data will
 * be ereased first.
 */
guint sat_cfg_load        ()
{
    gchar  *keyfile,*confdir;
    GError *error = NULL;

    if (config != NULL)
        sat_cfg_close ();

    /* load the configuration file */
    config = g_key_file_new ();
    confdir = get_user_conf_dir ();
    keyfile = g_strconcat (confdir, G_DIR_SEPARATOR_S, "gpredict.cfg", NULL);
    g_free (confdir);

    g_key_file_load_from_file (config, keyfile, G_KEY_FILE_KEEP_COMMENTS, &error);

    g_free (keyfile);

    if (error != NULL) {

        sat_log_log (SAT_LOG_LEVEL_WARN,
                     _("%s: Error reading config file (%s)"),
                     __FUNCTION__, error->message);

        sat_log_log (SAT_LOG_LEVEL_WARN,
                     _("%s: Using built-in defaults"),
                     __FUNCTION__);

        g_clear_error (&error);

        return 1;
    }
    else {
        sat_log_log (SAT_LOG_LEVEL_DEBUG,
                     _("%s: Everything OK."), __FUNCTION__);
    }

    /* if config version is < 1.1; reset SAT_CFG_STR_TLE_FILES */
    guint ver;
    ver = 10*sat_cfg_get_int (SAT_CFG_INT_VERSION_MAJOR) + sat_cfg_get_int (SAT_CFG_INT_VERSION_MINOR);
    if (ver < 11) {
        sat_cfg_reset_str (SAT_CFG_STR_TLE_FILES);
        sat_cfg_set_int (SAT_CFG_INT_VERSION_MAJOR, 1);
        sat_cfg_set_int (SAT_CFG_INT_VERSION_MINOR, 1);
    }


    return 0;
}
开发者ID:brunovianna,项目名称:GPredict---OSC,代码行数:58,代码来源:sat-cfg.c

示例14: delete_cb

/** \brief Close and permanently delete module.
 *
 * This function is called when the user selects the delete menu
 * item in the GtkSatModule popup menu. First it will close the module
 * with gtk_sat_module_close_cb, which will close the current module,
 * whereafter the module file will be deleted from the disk.
 */
static void delete_cb (GtkWidget *menuitem, gpointer data)
{
    gchar *file;
    GtkWidget *dialog;
    gchar *moddir;

    moddir = get_modules_dir ();
    file = g_strconcat (moddir, G_DIR_SEPARATOR_S,
                        GTK_SAT_MODULE (data)->name, ".mod", NULL);
    g_free (moddir);

    gtk_sat_module_close_cb (menuitem, data);


    /* ask user to confirm removal */
    dialog = gtk_message_dialog_new_with_markup
             (NULL, //GTK_WINDOW (parent),
              GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
              GTK_MESSAGE_QUESTION,
              GTK_BUTTONS_YES_NO,
              _("This operation will permanently delete\n<b>%s</b>\n"\
                "from the disk.\nDo you you want to proceed?"),
              file);

    switch (gtk_dialog_run (GTK_DIALOG (dialog))) {

    case GTK_RESPONSE_YES:

        if (g_remove (file)) {
            sat_log_log (SAT_LOG_LEVEL_ERROR,
                         _("%s:%d: Failed to delete %s."),
                         __FILE__, __LINE__, file);
        }
        else {
            sat_log_log (SAT_LOG_LEVEL_ERROR,
                         _("%s:%d: %s deleted permanently."),
                         __FILE__, __LINE__, file);
        }
        break;

     default:
        break;
    }

    gtk_widget_destroy (dialog);

    g_free (file);
}
开发者ID:nfischer,项目名称:gpredict,代码行数:55,代码来源:gtk-sat-module-popup.c

示例15: mod_cfg_get_int

gint
mod_cfg_get_int  (GKeyFile *f, const gchar *sec, const gchar *key, sat_cfg_int_e p)
{
     GError  *error = NULL;
     gint     param;

     /* check whether parameter is present in GKeyFile */
     if (g_key_file_has_key (f, sec, key, NULL)) {

          param = g_key_file_get_integer (f, sec, key, &error);

          if (error != NULL) {

               sat_log_log (SAT_LOG_LEVEL_ERROR,
                         _("%s: Failed to read integer (%s)"),
                         __FUNCTION__, error->message);

               g_clear_error (&error);

               /* get a timeout from global config */
               param = sat_cfg_get_int (p);
          }
     }
     /* get value from sat-cfg */
     else {
          param = sat_cfg_get_int (p);

/*           sat_log_log (SAT_LOG_LEVEL_DEBUG, */
/*                     _("%s: Integer value not found, using default (%d)"), */
/*                     __FUNCTION__, param); */
     }

     return param;
}
开发者ID:alejoduque,项目名称:GPredict---OSC,代码行数:34,代码来源:mod-cfg-get-param.c


注:本文中的sat_log_log函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。