コード例 #1
0
ファイル: plugin_utils.cpp プロジェクト: yunzhi-wu/vMCA
bool CGraph::AddBox(double x1, float y1, double x2, float y2, unsigned int row, char* label_p, unsigned char labelLength, int fillColorRGB)
{
  unsigned int totalObjectSize = sizeof(GraphicalObject_Box_Ex_t) + labelLength + 1; // +1 for EOL

  GraphicalObject_Box_Ex_t* newBox_p = (GraphicalObject_Box_Ex_t*)m_byteStreamManager_p->AddBytes(totalObjectSize);

  if (newBox_p == NULL)
  {
    ErrorHook("CGraph::AddBox failed, out of memory\n");
    return false;
  }

  ++m_numOfObjects;

  if (x1 > x2)
  {
    double temp_x = x2;
    x2  = x1;
    x1  = temp_x;

    ErrorHook("CGraph::AddBox failed, input parameter error\n");
  }

  if (y1 > y2)
  {
    float temp_y = y2;
    y2  = y1;
    y1  = y2;

    ErrorHook("CGraph::AddBox failed, input parameter error\n");
  }

  memset(newBox_p, 0, totalObjectSize);

  GraphicalObject_t* go_p = &newBox_p->go;

  go_p->x1          = x1;
  go_p->y1          = y1;
  go_p->x2          = x2;
  go_p->y2          = y2;
  go_p->row         = row;

  go_p->properties  = GRAPHICAL_OBJECT_KIND_BOX_EX_LABEL_STR;

  newBox_p->fillColorRGB                      = fillColorRGB;
  newBox_p->label.labelKind.textLabel.length  = labelLength;

  memcpy(&newBox_p->label.labelKind.textLabel.label_a, label_p, labelLength);

  (&newBox_p->label.labelKind.textLabel.label_a)[labelLength] = 0;  // Add EOL

  UpdateExtents(go_p);

  return true;
}
コード例 #2
0
ファイル: plugin_utils.cpp プロジェクト: yunzhi-wu/vMCA
bool CGraph::AddLine(double x1, float y1, double x2, float y2, unsigned int row, char* label_p, unsigned char labelLength, int lineColorRGB, float relative_X, unsigned int lineEnds)
{
  unsigned int totalObjectSize = sizeof(GraphicalObject_Line_Ex_t) + labelLength + 1;  // +1 for EOL

  GraphicalObject_Line_Ex_t* newLine_p = (GraphicalObject_Line_Ex_t*)m_byteStreamManager_p->AddBytes(totalObjectSize);

  if (newLine_p == NULL)
  {
    ErrorHook("CGraph::AddLine_Ex failed, out of memory\n");
    return false;
  }

  ++m_numOfObjects;

  if (x1 > x2)
  {
    ErrorHook("CGraph::AddLine failed, input parameter error\n");

    double temp = x2;
    x2  = x1;
    x1  = temp;
  }

  memset(newLine_p, 0, totalObjectSize);

  GraphicalObject_t* go_p = &newLine_p->go;

  go_p->properties  = GRAPHICAL_OBJECT_KIND_LINE_EX_LABEL_STR | lineEnds;

  go_p->x1          = x1;
  go_p->y1          = y1;
  go_p->x2          = x2;
  go_p->y2          = y2;
  go_p->row         = row;

  newLine_p->lineColorRGB                     = lineColorRGB;
  newLine_p->relative_X                       = relative_X;
  newLine_p->label.labelKind.textLabel.length = labelLength;

  if (label_p != NULL && labelLength > 0)
  {
    memcpy(&newLine_p->label.labelKind.textLabel.label_a, label_p, labelLength);
  }

  (&newLine_p->label.labelKind.textLabel.label_a)[labelLength] = 0;  // Add EOL

  UpdateExtents(go_p);

  return true;
}
コード例 #3
0
ファイル: plugin_utils.cpp プロジェクト: yunzhi-wu/vMCA
bool CGraph::AddBox(double x1, float y1, double x2, float y2, unsigned int row, unsigned int labelIndex, int fillColorRGB)
{
  GraphicalObject_Box_Ex_t* newBox_p = (GraphicalObject_Box_Ex_t*)m_byteStreamManager_p->AddBytes(sizeof(GraphicalObject_Box_Ex_t));

  if (newBox_p == NULL)
  {
    ErrorHook("CGraph::AddBox failed, out of memory\n");
    return false;
  }

  ++m_numOfObjects;

  if (x1 > x2)
  {
    double temp_x = x2;
    x2  = x1;
    x1  = temp_x;

    ErrorHook("CGraph::AddBox failed, input parameter error\n");
  }

  if (y1 > y2)
  {
    float temp_y = y2;
    y2  = y1;
    y1  = y2;

    ErrorHook("CGraph::AddBox failed, input parameter error\n");
  }

  memset(newBox_p, 0, sizeof(GraphicalObject_Box_Ex_t));

  GraphicalObject_t* go_p = &newBox_p->go;

  go_p->x1          = x1;
  go_p->y1          = y1;
  go_p->x2          = x2;
  go_p->y2          = y2;
  go_p->row         = row;

  go_p->properties  = GRAPHICAL_OBJECT_KIND_BOX_EX_LABEL_INDEX;

  newBox_p->fillColorRGB                = fillColorRGB;
  newBox_p->label.labelKind.labelIndex  = labelIndex;

  UpdateExtents(go_p);

  return true;
}
コード例 #4
0
ファイル: plugin_utils.cpp プロジェクト: yunzhi-wu/vMCA
bool CGraph::AddLine(double x1, float y1, double x2, float y2, unsigned int row, unsigned int labelIndex, int lineColorRGB, float relative_X, unsigned int lineEnds)
{
  GraphicalObject_Line_Ex_t* newLine_p = (GraphicalObject_Line_Ex_t*)m_byteStreamManager_p->AddBytes(sizeof(GraphicalObject_Line_Ex_t));

  if (newLine_p == NULL)
  {
    ErrorHook("CGraph::AddLine_Ex failed, out of memory\n");
    return false;
  }

  ++m_numOfObjects;

  memset(newLine_p, 0, sizeof(GraphicalObject_Line_Ex_t));

  GraphicalObject_t* go_p = &newLine_p->go;

  go_p->properties  = GRAPHICAL_OBJECT_KIND_LINE_EX_LABEL_INDEX | lineEnds;

  go_p->x1          = x1;
  go_p->y1          = y1;
  go_p->x2          = x2;
  go_p->y2          = y2;
  go_p->row         = row;

  newLine_p->lineColorRGB                     = lineColorRGB;
  newLine_p->relative_X                       = relative_X;
  newLine_p->label.labelKind.labelIndex       = labelIndex;

  UpdateExtents(go_p);

  return true;
}
コード例 #5
0
ファイル: osctrl.c プロジェクト: parai/OpenOSEK
EXPORT void knl_call_errorhook(StatusType ercd)
{
    static call_count = 0;
    call_count++;
    if(1 == call_count)
    {
        ErrorHook(ercd);
    }
    call_count--;
}
コード例 #6
0
ファイル: osctl.c プロジェクト: ev3osek/ev3osek
/*
 *  �G���[�t�b�N�̌Ăяo��
 */
void
call_errorhook(StatusType ercd, OSServiceIdType svcid)
{
	UINT8	saved_callevel;
	IPL	saved_ipl;
	volatile FP	errorhook_adr;
	
	/*
	 *  C�����̋K�i�ł͊֐��̃A�h���X��0�ɂȂ��Ȃ��Ƃ����O�񂩂�,
	 *  �R���p�C���̍œK���ɂ���ErrorHook�̃A�h���X���蕪����
	 *  �폜�����Ă��܂��ꍇ�����邽��, volatile�w�肵�����[�J���ϐ���
	 *  �A�h���X���������Ă��画�肵�Ă����D
	*/
	errorhook_adr = (FP)ErrorHook;
	
	if (sus_all_cnt > 0) {
		if ((errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			ErrorHook(ercd);
		}
		ShutdownOS(E_OS_CALLEVEL);	/* �񕜕s�”\ */
	}
	else {
		if (( errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			saved_callevel = callevel;
			callevel = TCL_ERROR;
			saved_ipl = current_ipl();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(ipl_maxisr2);
			}
			unlock_cpu();
			ErrorHook(ercd);
			lock_cpu();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(saved_ipl);
			}
			callevel = saved_callevel;	
		}
	}
}
コード例 #7
0
ファイル: osctl.c プロジェクト: Ashatta/tools
/*
 *  エラーフックの呼び出し
 */
void
call_errorhook(StatusType ercd, OSServiceIdType svcid)
{
	UINT8	saved_callevel;
	IPL	saved_ipl;
	volatile FP	errorhook_adr;
	
	/*
	 *  C言語の規格では関数のアドレスは0にならないという前提から,
	 *  コンパイラの最適化によりErrorHookのアドレス判定分岐が
	 *  削除されてしまう場合があるため, volatile指定したローカル変数に
	 *  アドレスを代入してから判定している.
	*/
	errorhook_adr = (FP)ErrorHook;
	
	if (sus_all_cnt > 0) {
		if ((errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			ErrorHook(ercd);
		}
		ShutdownOS(E_OS_CALLEVEL);	/* 回復不可能 */
	}
	else {
		if (( errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			saved_callevel = callevel;
			callevel = TCL_ERROR;
			saved_ipl = current_ipl();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(ipl_maxisr2);
			}
			unlock_cpu();
			ErrorHook(ercd);
			lock_cpu();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(saved_ipl);
			}
			callevel = saved_callevel;	
		}
	}
}
コード例 #8
0
ファイル: plugin_utils.cpp プロジェクト: yunzhi-wu/vMCA
bool CGraph::AddLine(double x1, float y1, double x2, float y2, unsigned int row)
{
  GraphicalObject_Line_t* newLine_p = (GraphicalObject_Line_t*)m_byteStreamManager_p->AddBytes(sizeof(GraphicalObject_Line_t));

  if (newLine_p == NULL)
  {
    ErrorHook("CGraph::AddLine failed, out of memory\n");
    return false;
  }

  ++m_numOfObjects;

  if (x1 > x2)
  {
    ErrorHook("CGraph::AddLine failed, input parameter error\n");

    double temp = x2;
    x2  = x1;
    x1  = temp;
  }

  memset(newLine_p, 0, sizeof(GraphicalObject_Line_t));

  GraphicalObject_t* go_p = &newLine_p->go;

  go_p->x1          = x1;
  go_p->y1          = y1;
  go_p->x2          = x2;
  go_p->y2          = y2;
  go_p->row         = row;

  go_p->properties  = GRAPHICAL_OBJECT_KIND_LINE;

  UpdateExtents(go_p);

  return true;
}
コード例 #9
0
void OsErrorCallErrorHook(StatusType Error)
#endif /* KOS_MEMORY_MAPPING */
{
    if (((Os_Flags & OS_SYS_FLAG_IN_OS_ERROR_HOOK) != OS_SYS_FLAG_IN_OS_ERROR_HOOK)) {
        DISABLE_ALL_OS_INTERRUPTS();
        Os_Flags |= OS_SYS_FLAG_IN_OS_ERROR_HOOK;
        OS_SAVE_CALLEVEL(); /* s. 'os_alm' !!! */
        OS_SET_CALLEVEL(OS_CL_ERROR_HOOK);
        OS_SAVE_LAST_ERROR(Error);
        ErrorHook(Error);
        OS_RESTORE_CALLEVEL();
        Os_Flags &= (uint8)~OS_SYS_FLAG_IN_OS_ERROR_HOOK;
        ENABLE_ALL_OS_INTERRUPTS();
    }
}
コード例 #10
0
ファイル: plugin_base.cpp プロジェクト: yunzhi-wu/vMCA
bool CPlot::AddMatchString(char* string_p, unsigned int length)
{
  if (m_matchStrings.numOfStrings < m_matchStrings.maxNumOfStrings)
  {
    memcpy(m_matchStrings.m_matchStringArray[m_matchStrings.numOfStrings].m_matchString, string_p, length);
    m_matchStrings.m_matchStringArray[m_matchStrings.numOfStrings].m_length  = length;

    ++m_matchStrings.numOfStrings;
  }
  else
  {
    ErrorHook("Too many match strings added to plugin");
    return false;
  }

  return true;
}
コード例 #11
0
void Sleep(uint32_t nofTicks, TaskType TaskID, EventMaskType Mask )
{
	imask_t state;
    Irq_Save(state);
	if(nofTicks == 0){
		nofTicks=1;
	}
    if(TaskID < OS_TASK_CNT){
        timeoutlist[TaskID].timeout = ticks + nofTicks;
        timeoutlist[TaskID].active = TRUE;
        timeoutlist[TaskID].mask = Mask;
    }else{
        /* Error */
    	ErrorHook(E_OS_LIMIT);
    }
    Irq_Restore(state);
}
コード例 #12
0
ファイル: plugin_utils.cpp プロジェクト: yunzhi-wu/vMCA
lifeLine_h CSequenceDiagram::AddLifeLine(float y1, float y2, char* label_p, unsigned char labelLength, int colorRGB)
{

  // 1. Add the life line box
  // 2. Add the life line line

  unsigned int totalObjectSize = sizeof(GraphicalObject_LifeLine_Box_t) + labelLength;

  // Add the lifeline box in the m_decorator member
  GraphicalObject_LifeLine_Box_t* newLifeLine_Box_p = (GraphicalObject_LifeLine_Box_t*)  m_decorator_p->m_byteStreamManager_p->AddBytes(totalObjectSize);

  if (newLifeLine_Box_p == NULL)
  {
    ErrorHook("CSequenceDiagram::AddLifeLine Box failed, out of memory\n");
    return (lifeLine_h)NULL;
  }

#ifdef _DEBUG

  if (y1 > y2)
  {
    float temp_y = y2;
    y2  = y1;
    y1  = temp_y;

    ErrorHook("CSequenceDiagram::AddLifeLine y1 is larger than y2\n");
  }

#endif

  memset(newLifeLine_Box_p, 0, totalObjectSize);

  GraphicalObject_t* go_p = &newLifeLine_Box_p->go;

  go_p->x1          = 0.0;
  go_p->y1          = y1;
  go_p->x2          = 0.0;
  go_p->y2          = y2;

  const float halfHeigth = (y2 - y1) / 2.0f;

  newLifeLine_Box_p->y_center     = y1 + halfHeigth;
  newLifeLine_Box_p->y_execTop    = newLifeLine_Box_p->y_center + halfHeigth * 0.3f;
  newLifeLine_Box_p->y_execBottom = newLifeLine_Box_p->y_center - halfHeigth * 0.3f;

  go_p->row         = 0;
  go_p->properties  = GRAPHICAL_OBJECT_KIND_DECORATOR_LIFELINE | GRAPHICAL_OBJECT_KIND_BOX_EX_LABEL_STR;

  newLifeLine_Box_p->fillColorRGB                      = colorRGB;
  newLifeLine_Box_p->label.labelKind.textLabel.length  = labelLength;

  memcpy(&newLifeLine_Box_p->label.labelKind.textLabel.label_a, label_p, labelLength);

  ++m_decorator_p->m_numOfObjects;

  // 2. Add the life line line

  totalObjectSize = sizeof(GraphicalObject_LifeLine_Line_t) + labelLength;

  // Add the lifeline box in the m_decorator member
  GraphicalObject_LifeLine_Line_t* newLifeLine_Line_p = (GraphicalObject_LifeLine_Line_t*)  m_decorator_p->m_byteStreamManager_p->AddBytes(totalObjectSize);

  if (newLifeLine_Line_p == NULL)
  {
    ErrorHook("CSequenceDiagram::AddLifeLine Line failed, out of memory\n");
    return (lifeLine_h)NULL;
  }

  memset(newLifeLine_Line_p, 0, totalObjectSize);

  go_p = &newLifeLine_Line_p->go;

  go_p->x1          = 0.0;
  go_p->y1          = newLifeLine_Box_p->y_center;
  go_p->x2          = 0.0;
  go_p->y2          = newLifeLine_Box_p->y_center;

  go_p->row         = 0;
  go_p->properties  = GRAPHICAL_OBJECT_KIND_DECORATOR_LIFELINE | GRAPHICAL_OBJECT_KIND_LINE_EX_LABEL_STR;

  newLifeLine_Line_p->lineColorRGB                      = colorRGB;
  newLifeLine_Line_p->label.labelKind.textLabel.length  = labelLength;
  newLifeLine_Line_p->relative_X                        = 0.2f;         // 20% in on the line

  memcpy(&newLifeLine_Line_p->label.labelKind.textLabel.label_a, label_p, labelLength);

  ++m_decorator_p->m_numOfObjects;

  return ((lifeLine_h)newLifeLine_Box_p);
}