📄 utilityfunc.c
字号:
/*============================================================================*/
/* Filename: *.c */
/* */
/* Description: This file contains the functions that ... */
/* */
/* Required Header File(s): ?.h */
/* */
/* Function List: */
/* ?() This function ... */
/* */
/*============================================================================*/
/* COPYRIGHT (C) 2001 */
/* NowTech, LLC */
/* Knoxville, TN */
/* */
/* ALL RIGHTS RESERVED */
/* */
/* This software and all information and ideas contained within are the sole */
/* property of NowTech, LLC and are confidential. Neither this software nor */
/* any part nor any information contained in it may be disclosed or furnished */
/* to others without the prior written consent of NowTech, LLC. */
/* */
/*============================================================================*/
/*============================================================================*/
/* System Level Include Files: */
/*============================================================================*/
#include <PalmOS.h>
/*============================================================================*/
/* Project Specific Include Files: */
/*============================================================================*/
#include "PocketAnalyzerRsc.h"
#include "GlobalDefs.h"
/*============================================================================*/
/* Define any data structures that are used exclusively by the functions */
/* local to this source file. */
/*============================================================================*/
/***** None *****/
/*============================================================================*/
/* Define all constants used by the functions in this source file. */
/*============================================================================*/
/***** None *****/
/*============================================================================*/
/* Define all variables which must have project global scope. All variables */
/* defined in this section will be accessible by all functions in all source */
/* files in this project and must have a corresponding extern statement in */
/* the GlobalDefs.h include file. */
/*============================================================================*/
/***** None *****/
/*============================================================================*/
/* Define all variables which must have source file global scope but not have */
/* project wide scope. These variables must be defined with the "static" */
/* type qualifier so that the variables scope will be limited to only the */
/* functions in this source file. */
/*============================================================================*/
/***** None *****/
/*============================================================================*/
/* Define the function prototypes for all local functions. The prototypes */
/* for all global functions should be defined in the GlobalDefs.h include */
/* file. */
/*============================================================================*/
/***** None *****/
/***********************************************************************
*
* FUNCTION: GetObjectPtr
*
* DESCRIPTION: This routine returns a pointer to an object in the current
* form.
*
* PARAMETERS: formId - id of the form to display
*
* RETURNED: nothing
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* art 2/21/95 Initial Revision
*
***********************************************************************/
void* GetObjectPtr (UInt16 objectID)
{
FormPtr frm;
frm = FrmGetActiveForm ();
return (FrmGetObjectPtr (frm, FrmGetObjectIndex (frm, objectID)));
}
/*============================================================================*/
/* Function: SetFieldTest */
/* Description: This routine sets/changes the test in a field control.*/
/* */
/* Arguments: objectID = The ID of the field object to be modified. */
/* Returns: pSrcText = Pointer to the new text string. */
/* Globals affected: None */
/* Hardware affected: None */
/* */
/*============================================================================*/
/* Change History: */
/* */
/* ECO#: ? */
/* Change Date: dd-mmm-yyyy */
/* Changed By: ? */
/* Description of Change: ? */
/* */
/*============================================================================*/
void SetFieldText (UInt16 objectID, Char* pSrcText)
{
/*========================================================================*/
/* Declare all local variables. */
/*========================================================================*/
MemHandle hText;
Char* pText;
FieldPtr pFld;
/*========================================================================*/
/* Get the pointer to the field object that is to be modified. */
/*========================================================================*/
pFld = GetObjectPtr (objectID);
/*========================================================================*/
/* Free the handle to the old text in the field. */
/*========================================================================*/
hText = FldGetTextHandle (pFld);
if (hText) MemHandleFree (hText);
/*========================================================================*/
/* Establish a new handle and lock the handle.
/*========================================================================*/
hText = MemHandleNew (5);
pText = MemHandleLock (hText);
StrCopy (pText, pSrcText);
/*========================================================================*/
/* Unlock the text pointer and set the handle for the field. */
/*========================================================================*/
MemPtrUnlock (pText);
FldSetTextHandle (pFld, hText);
}
/*============================================================================*/
/* Function: CopyAppPrefs */
/* Description: This routine ... */
/* */
/* Arguments: *Dest = Pointer to the destination data structure. */
/* *Src = Pointer to the source data structure. */
/* Returns: None */
/* Globals affected: None */
/* Hardware affected: None */
/* */
/*============================================================================*/
/* Change History: */
/* */
/* ECO#: ? */
/* Change Date: dd-mmm-yyyy */
/* Changed By: ? */
/* Description of Change: ? */
/* */
/*============================================================================*/
void CopyAppPrefs (AppPrefsType *Dest, AppPrefsType *Src)
{
/*========================================================================*/
/* Declare all local variables. */
/*========================================================================*/
/***** None *****/
Dest->bAutoSweepMode = Src->bAutoSweepMode;
Dest->bGotoTrigOnRun = Src->bGotoTrigOnRun;
StrCopy (Dest->ChnlLabel[0], Src->ChnlLabel[0]);
StrCopy (Dest->ChnlLabel[1], Src->ChnlLabel[1]);
StrCopy (Dest->ChnlLabel[2], Src->ChnlLabel[2]);
StrCopy (Dest->ChnlLabel[3], Src->ChnlLabel[3]);
StrCopy (Dest->ChnlLabel[4], Src->ChnlLabel[4]);
StrCopy (Dest->ChnlLabel[5], Src->ChnlLabel[5]);
StrCopy (Dest->ChnlLabel[6], Src->ChnlLabel[6]);
StrCopy (Dest->ChnlLabel[7], Src->ChnlLabel[7]);
Dest->PreTrigger = Src->PreTrigger;
Dest->ChnlTriggers[0] = Src->ChnlTriggers[0];
Dest->ChnlTriggers[1] = Src->ChnlTriggers[1];
Dest->ChnlTriggers[2] = Src->ChnlTriggers[2];
Dest->ChnlTriggers[3] = Src->ChnlTriggers[3];
Dest->ChnlTriggers[4] = Src->ChnlTriggers[4];
Dest->ChnlTriggers[5] = Src->ChnlTriggers[5];
Dest->ChnlTriggers[6] = Src->ChnlTriggers[6];
Dest->ChnlTriggers[7] = Src->ChnlTriggers[7];
}
/*============================================================================*/
/* Function: PreTrigSmpls */
/* Description: This routine ... */
/* */
/* Arguments: ?_name = ?_description */
/* Returns: ?_description */
/* Globals affected: None */
/* Hardware affected: None */
/* */
/*============================================================================*/
/* Change History: */
/* */
/* ECO#: ? */
/* Change Date: dd-mmm-yyyy */
/* Changed By: ? */
/* Description of Change: ? */
/* */
/*============================================================================*/
UInt16 PreTrigSmpls (PreTriggerType PreTrigSetting)
{
/*========================================================================*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -