Esempio n. 1
0
//----------------------------------------
void CBratAlgoFilterKernel::SetBeginOfFile()
{
  CBratAlgoFilter::SetBeginOfFile();

  setDefaultValue(m_varValue);
  setDefaultValue(m_varValuePrev);
  setDefaultValue(m_varValueNext);

  //m_varDimXIndex = -1;
  //m_varDimYIndex = -1;

  //m_indexX = -1;
  //m_indexY = -1;

  setDefaultValue(m_validPts);
  
  m_rawDataWindow.RemoveAll();
  
  m_field2DAsRef = NULL;
  m_countY = 0;
  m_countX = 0;
  m_addHeightBottom = 0;
  m_addHeightTop = 0;
  m_addWidthRight = 0;
  m_addWidthLeft = 0;
  m_gapWidth = 0;
  m_gapHeight = 0;

  m_lastIndexDataToInsert = 0;

  DeleteFieldNetCdf();

}
Esempio n. 2
0
CPolyOff6_11::CPolyOff6_11()
{
	setDefaultValue(1, 1);
	setDefaultValue(2, 1);
	setValueStep(1, 0.1);
	setValueStep(2, 0.1);
}
Esempio n. 3
0
//----------------------------------------
void CBratAlgoFilterKernel::Init()
{
  setDefaultValue(m_dataWindowHeight);
  setDefaultValue(m_dataWindowWidth);

  setDefaultValue(m_dataWindowLength);
  setDefaultValue(m_extrapolate);

  SetBeginOfFile();
}
Esempio n. 4
0
void TIntParam::loadData(TIStream &is)
{
	int def, value;
	is >> def;
	if (is.eos()) {
		def += 1;
		setDefaultValue(def);
		setValue(def, false);
		return;
	}
	setDefaultValue(def);
	is >> value;
	setValue(value, false);
}
seqan::ArgumentParser::ParseResult parseCommandLine(ModifyStringOptions & options, int argc, char const ** argv)
{
	seqan::ArgumentParser parser("w1/(soon w50)_creator");
	addOption(parser, seqan::ArgParseOption("i", "input-file", "Path to the input file", seqan::ArgParseArgument::INPUT_FILE, "IN"));
	setRequired(parser, "input-file");
	setShortDescription(parser, "Methylation Tools");
	setVersion(parser, "0.0.6");
	setDate(parser, "November 2017");
	addUsageLine(parser, "-i CX_report.txt [\\fIOPTIONS\\fP] ");
	addOption(parser, seqan::ArgParseOption("l", "window-length", "Size of window",seqan::ArgParseArgument::INTEGER, "INT"));
	setDefaultValue(parser, "window-length", "50");

	addDescription(parser, "Create a w1 (and soon w50) file from a CX report.");
	seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv);

	// If parsing was not successful then exit with code 1 if there were errors.
	// Otherwise, exit with code 0 (e.g. help was printed).
	if (res != seqan::ArgumentParser::PARSE_OK)
		return res;

	getOptionValue(options.inputFileName, parser, "input-file");
	getOptionValue(options.window_length, parser, "window-length");

	return seqan::ArgumentParser::PARSE_OK;

}
Esempio n. 6
0
void EntityProperties::setWidgetValue()
{
	InternalOperation = true;
	if (targetSprite->isHasEntityProperties()){
		this->setVisible(true);
		
		numGenerate->setText(QString::number(targetSprite->getNumGenerate()));
		generateDelay->setText(QString::number(targetSprite->getGenerateDelay()));
		sleepTime->setText(QString::number(targetSprite->getSleepTime()));
		switch (targetSprite->getType()){
		case SpriteType::DYNAMIC_BLOCK:
			entity_Type->clear();
			entity_Type->addItem(FontChina::G2U("动态块"));
			break;
		case SpriteType::MONSTER:
			entity_Type->clear();
			entity_Type->addItem(FontChina::G2U("怪"));
			entity_Type->addItem(FontChina::G2U("角色"));
			entity_Type->setCurrentIndex(0);
			break;
		case SpriteType::ROLE:
			entity_Type->clear();
			entity_Type->addItem(FontChina::G2U("怪"));
			entity_Type->addItem(FontChina::G2U("角色"));
			entity_Type->setCurrentIndex(1);
			break;
		}
	}
	else{
		this->setVisible(false);
		setDefaultValue();
	}
	InternalOperation = false;
}
Esempio n. 7
0
//----------------------------------------
void CBratAlgoFilterKernel::SetEndOfFile()
{
  CBratAlgoFilter::SetEndOfFile();

  setDefaultValue(m_varValueNext);

}
Esempio n. 8
0
  NDBT_Attribute(const char* _name,
		 NdbDictionary::Column::Type _type,
		 int _length = 1,
		 bool _pk = false, 
		 bool _nullable = false,
		 CHARSET_INFO *cs= 0,
		 NdbDictionary::Column::StorageType storage = NdbDictionary::Column::StorageTypeMemory,
                 bool dynamic = false,
                 const void* defaultVal = NULL,
                 Uint32 defaultValBytes = 0):
    NdbDictionary::Column(_name)
  {
    assert(_name != 0);
    
    setType(_type);
    setLength(_length);
    setNullable(_nullable);
    setPrimaryKey(_pk);
    if (cs)
    {
      setCharset(cs);
    }
    setStorageType(storage);
    setDynamic(dynamic);
    setDefaultValue(defaultVal, defaultValBytes);
  }
Esempio n. 9
0
void TFilePathParam::loadData(TIStream &is)
{
	TFilePath def, value;
	is >> def >> value;
	setDefaultValue(def);
	setValue(value, false);
}
Esempio n. 10
0
//=========================================================
void TStringParam::loadData(TIStream &is)
{
	wstring def, value;
	is >> def >> value;
	setDefaultValue(def);
	setValue(value, false);
}
Esempio n. 11
0
void TBoolParam::loadData(TIStream &is)
{
	int def, value;
	is >> def >> value;
	setDefaultValue(def ? true : false);
	setValue(value ? true : false, false);
}
Esempio n. 12
0
//=========================================================
void TNADoubleParam::loadData(TIStream &is)
{
	double def, value;
	is >> def >> value;
	setDefaultValue(def);
	setValue(value, false);
}
Esempio n. 13
0
void SVConditionParam::SetMapNode(MAPNODE &mapnode)
{
    setStyleClass("t3");
    EnumParam(mapnode);
    setDefaultValue();

    SetCondition(mapnode);
}
Esempio n. 14
0
//----------------------------------------
void CBratAlgoFilterGaussian1D::Init()
{
  m_expectedTypes.Insert(static_cast<int32_t>(CBratAlgorithmParam::T_DOUBLE));

  setDefaultValue(m_dataWindowLength);

  SetBeginOfFile();
}
Esempio n. 15
0
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 设置节点
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
void SVConditionParam::SetMapNode(MAPNODE &mapnode)
{
    EnumParam(mapnode);

    setDefaultValue();

    SetCondition(mapnode);
}
Esempio n. 16
0
//----------------------------------------
void CBratAlgoFilterLoess2D::SetBeginOfFile()
{
  CBratAlgoFilterLoess::SetBeginOfFile();

  setDefaultValue(m_loess);



}
Esempio n. 17
0
/*!
    Constructs a command line option object with the given arguments.

    The name of the option is set to \a name.
    The name can be either short or long. If the name is one character in
    length, it is considered a short name. Option names must not be empty,
    must not start with a dash or a slash character, must not contain a \c{=}
    and cannot be repeated.

    The description is set to \a description. It is customary to add a "."
    at the end of the description.

    In addition, the \a valueName can be set if the option expects a value.
    The default value for the option is set to \a defaultValue.

    \sa setDescription(), setValueName(), setDefaultValues()
*/
QCommandLineOption::QCommandLineOption(const QString &name, const QString &description,
                                       const QString &valueName,
                                       const QString &defaultValue)
   : d(new QCommandLineOptionPrivate)
{
   d->setNames(QStringList(name));
   setValueName(valueName);
   setDescription(description);
   setDefaultValue(defaultValue);
}
Esempio n. 18
0
ControlLogpotmeter::ControlLogpotmeter(ConfigKey key, double dMaxValue, double minDB)
    : ControlPotmeter(key, 0, dMaxValue) {
    // Override ControlPotmeters default value of 0.5
    setDefaultValue(1.0);
    set(1.0);

    if (m_pControl) {
        m_pControl->setBehavior(
                new ControlLogPotmeterBehavior(0, dMaxValue, minDB));
    }
}
Esempio n. 19
0
/* -------- ------------------------------------------------------
   Purpose: Creates a new logarithmic potmeter, where the value is
            given by:

                value = 10^(b*midibyte) - 1

            The lower value is 0, for midibyte=64 the value is 1 and the upper
            value is set by maxvalue.

            If the maxvalue is set to 1, the potmeter operates with only
            one logarithmid scale between 0 (for midi 0) and 1 (midivalue 128).
   Input:   n - name
            midino - number of the midi controller.
            midicontroller - pointer to the midi controller.
   -------- ------------------------------------------------------ */
ControlLogpotmeter::ControlLogpotmeter(ConfigKey key, double dMaxValue)
    : ControlPotmeter(key, 0, dMaxValue) {
    // Override ControlPotmeters default value of 0.5
    setDefaultValue(1.0);
    set(1.0);

    if (m_pControl) {
        ControlNumericBehavior* pOldBehavior = m_pControl->setBehavior(
            new ControlLogpotmeterBehavior(dMaxValue));
        delete pOldBehavior;
    }
}
Esempio n. 20
0
void EntityProperties::setValueFromFile(QString file, bool clearTarget)
{
	InternalOperation = true;
	if (clearTarget){
		targetSprite = NULL;
	}
	QFile sFile(file);
	QJsonObject obj = readFileGetQJsonObject(file);
	if (fileError){
		MyLogger::getInstance()->addWarning("EntityProperties::setValueFromFile readTemplateFile error, filename " + file);
		InternalOperation = false;
		return;
	}
	templateFile = file;
	QJsonObject properties = obj["entityProperties"].toObject();

	setCheckState(selectNameVec, properties);

	bool hasEntityProperties = obj["hasEntityProperties"].toBool();
	if (targetSprite){
		targetSprite->setHasEntityProperties(hasEntityProperties);
	}
	if (!hasEntityProperties){
		this->setVisible(false);
		setDefaultValue();
	}
	else{
		this->setVisible(true);
		numGenerate->setText(QString::number(properties["numGenerate"].toInt()));
		generateDelay->setText(QString::number(properties["generateDelay"].toDouble()));
		sleepTime->setText(QString::number(properties["sleepTime"].toDouble()));
		entity_Type->clear();
		switch (properties["spriteType"].toInt()){
		case 0:
			break;
		case 1:
			entity_Type->addItem(FontChina::G2U("动态块"));
			break;
		case 2:
			entity_Type->addItem(FontChina::G2U("怪"));
			entity_Type->addItem(FontChina::G2U("角色"));
			entity_Type->setCurrentIndex(0);
			break;
		case 3:
			entity_Type->addItem(FontChina::G2U("怪"));
			entity_Type->addItem(FontChina::G2U("角色"));
			entity_Type->setCurrentIndex(1);
			break;
		}
	}
	InternalOperation = false;
}
Esempio n. 21
0
seqan::ArgumentParser::ParseResult
parseArgs(FxSamCoverageOptions & options,
          int argc,
          char const ** argv)
{
    seqan::ArgumentParser parser("fx_sam_coverage");
    setShortDescription(parser, "Read Coverage Computation.");
    setVersion(parser, "0.1");
    setDate(parser, "August 2012");
    
    addUsageLine(parser, "[\\fIOPTIONS\\fP] \\fB-o\\fP \\fIOUT.tsv\\fP \\fIGENOME.fa\\fP \\fIMAPPING.sam\\fP");
    addDescription(parser, "Compute read coverage and C+G content for a genome.");

    // Two input files: Genome, and mapping.
    addArgument(parser, seqan::ArgParseArgument(seqan::ArgParseArgument::INPUTFILE));
    setValidValues(parser, 0, "fasta fa");
    addArgument(parser, seqan::ArgParseArgument(seqan::ArgParseArgument::INPUTFILE));
    setValidValues(parser, 1, "sam");

    // TODO(holtgrew): I want a custom help text!
    // addOption(parser, seqan::ArgParseOption("h", "help", "This helpful screen."));
    addOption(parser, seqan::ArgParseOption("v", "verbose", "Verbose, log to STDERR."));
    hideOption(parser, "verbose");
    addOption(parser, seqan::ArgParseOption("vv", "very-verbose", "Very verbose, log to STDERR."));
    hideOption(parser, "very-verbose");

    addSection(parser, "Main Options");
    addOption(parser, seqan::ArgParseOption("w", "window-size", "Set the size of the non-overlapping windows in base pairs.", seqan::ArgParseArgument::INTEGER, "NUM"));
    setDefaultValue(parser, "window-size", "10000");

    addSection(parser, "Output Options");
    addOption(parser, seqan::ArgParseOption("o", "out-path", "Path to the resulting file.  If omitted, result is printed to stdout.", seqan::ArgParseArgument::OUTPUTFILE, "TSV"));
    setRequired(parser, "out-path");
    setValidValues(parser, "out-path", "sam.coverage.tsv");

    seqan::ArgumentParser::ParseResult res = parse(parser, argc, argv);

    if (res == seqan::ArgumentParser::PARSE_OK)
    {
        getArgumentValue(options.inGenomePath, parser, 0);
        getArgumentValue(options.inSamPath, parser, 1);
        getOptionValue(options.outPath, parser, "out-path");

        if (isSet(parser, "verbose"))
            options.verbosity = 2;
        if (isSet(parser, "very-verbose"))
            options.verbosity = 3;
    }

    return res;
}
Esempio n. 22
0
bool OSArgument::setDefaultValue(int defaultValue)
{
  bool result = false;
  if (m_type == OSArgumentType::Integer){
    m_defaultValue.setValue(defaultValue);
    OS_ASSERT(hasDefaultValue());
    onChange();
    result = true;
  }
  else if (m_type == OSArgumentType::Double) {
    result = setDefaultValue(double(defaultValue));
  }
  return result;
}
Esempio n. 23
0
void GetUserInput::loadData(const QVariantMap & data, bool internal)
{
    if (!internal)
        Action::loadData(data, internal);

    if (data.contains("message") && data.value("message").type() == QVariant::String)
        setMessage(data.value("message").toString());

    if (data.contains("variable") && data.value("variable").type() == QVariant::String)
        setVariable(data.value("variable").toString());

    if (data.contains("defaultValue") && data.value("defaultValue").type() == QVariant::String)
        setDefaultValue(data.value("defaultValue").toString());
}
Esempio n. 24
0
void ControlPotmeter::setRange(double dMinValue, double dMaxValue) {
    m_dMinValue = dMinValue;
    m_dMaxValue = dMaxValue;
    m_dValueRange = m_dMaxValue - m_dMinValue;
    double default_value = m_dMinValue + 0.5 * m_dValueRange;

    if (m_pControl) {
        m_pControl->setBehavior(
                new ControlPotmeterBehavior(dMinValue, dMaxValue));
    }

    setDefaultValue(default_value);
    set(default_value);
    //qDebug() << "" << this << ", min " << m_dMinValue << ", max " << m_dMaxValue << ", range " << m_dValueRange << ", val " << m_dValue;
}
Esempio n. 25
0
ControlAudioTaperPot::ControlAudioTaperPot(ConfigKey key,
                                           double minDB, double maxDB,
                                           double neutralParameter)
        : ControlPotmeter(key) {

    // Override ControlPotmeters default value of 0.5
    setDefaultValue(1.0);
    set(1.0);

    if (m_pControl) {
        m_pControl->setBehavior(
                new ControlAudioTaperPotBehavior(minDB, maxDB,
                        neutralParameter));
    }
}
Esempio n. 26
0
ControlPotmeter::ControlPotmeter(ConfigKey key, double dMinValue, double dMaxValue,
                                 bool allowOutOfBounds,
                                 bool bIgnoreNops,
                                 bool bTrack,
                                 bool bPersist)
        : ControlObject(key, bIgnoreNops, bTrack, bPersist),
          m_controls(key) {
    setRange(dMinValue, dMaxValue, allowOutOfBounds);
    double default_value = dMinValue + 0.5 * (dMaxValue - dMinValue);
    setDefaultValue(default_value);
    if (!bPersist) {
        set(default_value);
    }
    //qDebug() << "" << this << ", min " << m_dMinValue << ", max " << m_dMaxValue << ", range " << m_dValueRange << ", val " << m_dValue;
}
Esempio n. 27
0
seqan::ArgumentParser::ParseResult
parseCommandLine(ModifyStringOptions & options, int argc, char const ** argv)
{
	// Setup ArgumentParser.
	seqan::ArgumentParser parser("modify_string");

	// We require one argument.
	addArgument(parser, seqan::ArgParseArgument(
	    seqan::ArgParseArgument::STRING, "TEXT"));

	// Define Options
	addOption(parser, seqan::ArgParseOption(
	    "i", "period", "Period to use for the index.",
	    seqan::ArgParseArgument::INTEGER, "INT"));
	setMinValue(parser, "period", "1");
	setDefaultValue(parser, "period", "1");
	addOption(parser, seqan::ArgParseOption(
	    "r", "range", "Range of the text to modify.",
	    seqan::ArgParseArgument::INTEGER, "INT", false, 2));
	addOption(parser, seqan::ArgParseOption(
	    "U", "uppercase", "Select to-uppercase as operation."));
	addOption(parser, seqan::ArgParseOption(
	    "L", "lowercase", "Select to-lowercase as operation."));

	// Parse command line.
	seqan::ArgumentParser::ParseResult res = seqan::parse(parser, argc, argv);

	// Only extract  options if the program will continue after parseCommandLine()
	if (res != seqan::ArgumentParser::PARSE_OK)
	    return res;

	// Extract option values.
	getOptionValue(options.period, parser, "period");
	getOptionValue(options.rangeBegin, parser, "range", 0);
	getOptionValue(options.rangeEnd, parser, "range", 1);
	options.toUppercase = isSet(parser, "uppercase");
	options.toLowercase = isSet(parser, "lowercase");
	seqan::getArgumentValue(options.text, parser, 0);

	// If both to-uppercase and to-lowercase were selected then this is an error.
	if (options.toUppercase && options.toLowercase)
	{
	    std::cerr << "ERROR: You cannot specify both to-uppercase and to-lowercase!\n";
	    return seqan::ArgumentParser::PARSE_ERROR;
	}

	return seqan::ArgumentParser::PARSE_OK;
}
Esempio n. 28
0
//----------------------------------------
double CBratAlgoFilterLoess2D::Run(CVectorBratAlgorithmParam& args)
{

  int32_t iRecord = m_callerProduct->GetCurrentRecordNumber();

  if (iRecord == m_callerProductRecordPrev)
  {
    // Do nothing: data have been already computed
    return m_loess;
  }

  m_varValueArray = NULL;

  setDefaultValue(m_loess);

  OpenProductFile();
  
  SetParamValues(args);

  if (GetDataWindowSize() < 1)
  {

    PrepareReturn();
    return m_loess;
  }

  if (GetDataWindowSize() == 1)
  {
    m_loess = m_varValue;
    PrepareReturn();
    return m_loess;
  }

  if ( m_varValueArray == NULL)
  {
    ComputeSingle();
  }
  else
  {
    ComputeMean();
  }


  PrepareReturn();

  return m_loess;

}
Esempio n. 29
0
/** Set attribute.
 * @param attr_name attribute name
 * @param attr_value attribute value.
 */
void
InterfaceField::setAttribute(const std::string &attr_name, const std::string &attr_value)
{
    if ( attr_name == "name" ) {
        setName(attr_value);
    } else if ( attr_name == "type" ) {
        setType(attr_value);
    } else if ( attr_name == "length" ) {
        setLength(attr_value);
    } else if ( attr_name == "validfor" ) {
        setValidFor(attr_value);
    } else if ( attr_name == "default" ) {
        setDefaultValue(attr_value);
    } else if ( attr_name == "flags" ) {
        tokenize(attr_value, flags, ",");
    }
}
Esempio n. 30
0
//----------------------------------------
double CBratAlgoFilterGaussian1D::ComputeGaussian()
{
  setDefaultValue(m_gaussian);

  size_t nbValues = m_rawDataWindow.size();

  size_t nbValidPoints = nbValues;
  CDoubleArray::const_iterator it;
  for (it = m_rawDataWindow.begin(); it != m_rawDataWindow.end(); it++)
  {
    if (isDefaultValue(*it))
    {
      nbValidPoints--;    
    }
  }

  if (nbValidPoints < m_validPts)
  {
    return m_gaussian;
  }

  //SumWeights(ModeHorizontal, 0);
  m_gaussian = ApplyFilter(ModeHorizontal, 0);
 
#if _DEBUG_BRAT_ALGO    
  CTrace::Tracer(3, CTools::Format("m_rawDataWindow contains (%d elements):", m_rawDataWindow.size()));
  std::string str;
  for (it = m_rawDataWindow.begin(); it != m_rawDataWindow.end(); it++)
  {
    if (CTools::IsDefaultValue(*it))
    {
      str.append("DV ");
    }
    else
    {
      str.append(CTools::Format("%f ", *it));
    }
  }

  CTrace::Tracer(3, str);
  CTrace::Tracer(3, CTools::Format("gaussian is: %f", m_gaussian));
#endif

  return m_gaussian;

}