コード例 #1
0
ファイル: RxHelper.php プロジェクト: grlf/eyedock
function rxStringBreaker($rxString)
{
    $cleanRxString = cleanRxString($rxString);
    $splitRxString = splitRxString($cleanRxString);
    $rxChunks = explode(":", $splitRxString);
    //print_r($rxChunks);
    $returnRx = new RxObject();
    if (count($rxChunks) > 0) {
        $returnRx->sph = removeLetters($rxChunks[0]);
    } else {
        $returnRx->sph = 0;
    }
    if (count($rxChunks) > 1) {
        $returnRx->cyl = removeLetters($rxChunks[1]);
    } else {
        $returnRx->cyl = 0;
    }
    if (count($rxChunks) > 2) {
        $returnRx->axis = removeLetters($rxChunks[2]);
    } else {
        $returnRx->axis = 0;
    }
    $checkSph = checkSphereRange($returnRx->sph);
    $checkCyl = checkSphereRange($returnRx->cyl);
    $checkAxis = checkAxisRange($returnRx->axis);
    if (!$checkSph || !$checkCyl || !$checkAxis) {
        return null;
    }
    return $returnRx;
}
コード例 #2
0
ファイル: RxObject.php プロジェクト: grlf/eyedock
 public function isValidRx()
 {
     //make sure each of these things is true
     $valid = checkSphereRange($this->sph);
     $valid += checkCylinderRange($this->cyl);
     $valid += checkAxisRange($this->axis);
     if ($valid < 3) {
         return 0;
     }
     return 1;
 }