示例#1
0
SimulatorGraphics::SimulatorGraphics(const QPointF& Coords,
                                     const QString& ID, unsigned int Order,
                                     const openfluid::machine::ModelItemSignatureInstance* Signature,
                                     QGraphicsItem* Parent):
  ModelItemGraphics(Coords,ID,ID,Order,Parent)
{
  openfluid::ware::SimulatorSignature* SimSign = Signature->Signature;

  m_Ghost = Signature->Ghost;

  m_RequiredVars = SimSign->HandledData.RequiredVars;
  m_UsedVars = SimSign->HandledData.UsedVars;
  m_ProducedVars = SimSign->HandledData.ProducedVars;
  m_UpdatedVars = SimSign->HandledData.UpdatedVars;

  // In/Out slots
  drawIOSlot(getRequiredIOPosition(),SlotType::SLOT_REQ,m_RequiredVars);
  drawIOSlot(getUsedIOPosition(),SlotType::SLOT_US,m_UsedVars);
  drawIOSlot(getUpInIOPosition(),SlotType::SLOT_UPIN,m_UpdatedVars);
  drawIOSlot(getProducedIOPosition(),SlotType::SLOT_PROD,m_ProducedVars);
  drawIOSlot(getUpOutIOPosition(),SlotType::SLOT_UPOUT,m_UpdatedVars);

  if (!m_Ghost)
    setBrush(QBrush(QColor(BUILDER_SIMULATOR_BGCOLOR)));
  else
    setBrush(QBrush(QColor(BUILDER_GHOST_BGCOLOR)));

}
GeneratorGraphics::GeneratorGraphics(const QPointF& Coords, const QString& ID,
                                     const QString& VarName, const QString& UnitClass,
                                     QGraphicsItem* Parent):
  ModelItemGraphics(Coords,ID,Parent)
{
  m_ProducedVars[UnitClass].append(VarName);

  // Out slot
  drawIOSlot(getProducedIOPosition(),"Prod",true);

  setBrush(QBrush(QColor(BUILDER_GENERATOR_BGCOLOR)));
}