예제 #1
0
    def calcTimeRate(self):
        for i in range(6):
            item = self.stdModel.item(3,
                                      self.data["CatOfAcftCount"][0] + 6 + i)
            val = 0.0
            try:
                val = float(item.text())
            except:
                continue
            time = (3600 * self.data["Distance"]) / val
            minute = int(time / 60)
            second = int(time % 60)

            timeStr = str(minute) + " : " + str(second)
            if second == 0:
                timeStr = str(minute) + " : " + "00"
            elif second < 10:
                timeStr = str(minute) + " : 0" + str(second)
            itemTemp = QStandardItem(timeStr)
            itemTemp.setTextAlignment(Qt.AlignCenter)
            self.stdModel.setItem(4, self.data["CatOfAcftCount"][0] + 6 + i,
                                  itemTemp)

            rate = int(
                (val * 6076.1 *
                 (AngleGradientSlope(self.data["DescentGradient"]).Percent /
                  float(100))) / float(60))
            itemTemp = QStandardItem(str(rate))
            itemTemp.setTextAlignment(Qt.AlignCenter)
            self.stdModel.setItem(5, self.data["CatOfAcftCount"][0] + 6 + i,
                                  itemTemp)
예제 #2
0
    def smethod_0(iwin32Window_0):
        num = 0
        str0 = ""
        navigationalAidList = NavigationalAidList()
        NavigationalAidList.NavigationalAidList()
        navigationalAidList.append(OmnidirectionalNavigationalAid("DME N", AngleGradientSlope(1), Distance(3000), Distance(300), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("VOR", AngleGradientSlope(1), Distance(3000), Distance(600), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("Directional Finder (DF)", AngleGradientSlope(1), Distance(3000), Distance(500), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("Markers", AngleGradientSlope(20), Distance(200), Distance(50), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("NDB", AngleGradientSlope(5), Distance(1000), Distance(200), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("GBAS ground reference receiver", AngleGradientSlope(3), Distance(3000), Distance(400), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("GBAS VDB station", AngleGradientSlope(0.9), Distance(3000), Distance(300), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("SBAS ground monitoring station", AngleGradientSlope(3), Distance(3000), Distance(400), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("VHF (Communication Tx)", AngleGradientSlope(1), Distance(2000), Distance(300), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("VHF (Communication Rx)", AngleGradientSlope(1), Distance(2000), Distance(300), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("PSR", AngleGradientSlope(0.25), Distance(15000), Distance(500), True))
        navigationalAidList.append(OmnidirectionalNavigationalAid("SSR", AngleGradientSlope(0.25), Distance(15000), Distance(500), True))
        navigationalAidList.append(DirectionalNavigationalAid("ILS LOC (single freq.)", Distance.NaN(), Distance(500), Altitude(70), Distance(6000), Distance(500), Altitude(10), Distance(2300), AngleGradientSlope(30), True))
        navigationalAidList.append(DirectionalNavigationalAid("ILS LOC (dual freq.)", Distance.NaN(), Distance(500), Altitude(70), Distance(6000), Distance(500), Altitude(20), Distance(1500), AngleGradientSlope(20), True))
        navigationalAidList.append(DirectionalNavigationalAid("ILS GP M-Type (dual freq.)", Distance(800), Distance(50), Altitude(70), Distance(6000), Distance(250), Altitude(5), Distance(325), AngleGradientSlope(10), True))
        navigationalAidList.append(DirectionalNavigationalAid("MLS AZ", Distance.NaN(), Distance(20), Altitude(70), Distance(6000), Distance(600), Altitude(20), Distance(1500), AngleGradientSlope(40), True))
        navigationalAidList.append(DirectionalNavigationalAid("MLS EL", Distance(300), Distance(20), Altitude(70), Distance(6000), Distance(200), Altitude(20), Distance(1500), AngleGradientSlope(40), True))
        navigationalAidList.append(DirectionalNavigationalAid("DME (directional antennas)", Distance.NaN(), Distance(20), Altitude(70), Distance(6000), Distance(600), Altitude(20), Distance(1500), AngleGradientSlope(40), True))
        try:
            if (QFile.exists(NavigationalAidList.fileName)):
                xmlFile = XmlFile(NavigationalAidList.fileName, "NavigationalAids", False)
                xmlNodeLists = xmlFile.elementsByTagName("NavigationalAid")
                if (xmlNodeLists != None):
                    count =  xmlNodeLists.count()
                    for i in range(count):
                        xmlElement = xmlNodeLists.item(i)
                    # foreach (XmlElement xmlElement in xmlNodeLists)
                        result1, num = xmlFile.method_7(xmlElement, "Type")
                        result2, str0 = xmlFile.method_7(xmlElement, "Name")
                        if (not result1 or not result2):
                            continue
                        for case in switch(num):
                            if case(NavigationalAidType.Omnidirectional):
                                navigationalAidList.Add(OmnidirectionalNavigationalAid(None, xmlFile, xmlElement, str0))
                                continue
                            elif case(NavigationalAidType.Directional):
                                navigationalAidList.Add(DirectionalNavigationalAid(None, xmlFile, xmlElement, str0))
                                continue
                            elif case(NavigationalAidType.LineOfSight):
                                navigationalAidList.Add(LineOfSight(None, xmlFile, xmlElement, str0))
                                continue
                            else:
                                continue
        except:
            # Exception exception = exception1
            QMessageBox.warning(iwin32Window_0, "Error", Messages.ERR_FAILED_TO_LOAD_NAVAID_DATA_FILE)
            # ErrorMessageBox.smethod_0(iwin32Window_0, string.Format(Messages.ERR_FAILED_TO_LOAD_NAVAID_DATA_FILE, exception.Message))

        navigationalAidList.method_1()
        return navigationalAidList
 def txtDegreeChanged(self):
     try:
         test = float(self.txtDegree.text())
         if self.flag == 0:
             self.flag = 2
         if self.flag == 1:
             self.flag = 0
         if self.flag == 2:
             try:
                 self.txtPercent.setText(
                     str(
                         round(
                             AngleGradientSlope(float(
                                 self.txtDegree.text())).Percent, 4)))
             except:
                 self.txtPercent.setText("0.0")
             self.emit(SIGNAL("Event_0"), self)
     except:
         str0 = "You must input the float type in \"%s\"." % (self.Caption)
         QMessageBox.warning(self, "Warning", str0)
         self.txtPercent.setText("0.0")
 def get_Value(self):
     return AngleGradientSlope(float(self.txtDegree.text()))
예제 #5
0
 def set_Criteria(self, value):
     if value == None:
         return
     self.criteria = value
     self.pnlName.Value = self.criteria.Name
     if (self.criteria.Approach.Enabled):
         self.pnlAPP_InnerEdge.Value = Distance(
             self.criteria.Approach.InnerEdge)
         self.pnlAPP_DistFromTHR.Value = Distance(
             self.criteria.Approach.DistFromTHR)
         self.pnlAPP_Divergence.Value = AngleGradientSlope(
             self.criteria.Approach.Divergence,
             AngleGradientSlopeUnits.Percent)
         self.pnlAPP_Length1.Value = Distance(
             self.criteria.Approach.Length1)
         self.pnlAPP_Slope1.Value = AngleGradientSlope(
             self.criteria.Approach.Slope1, AngleGradientSlopeUnits.Percent)
         if (self.criteria.Approach.HasSection2):
             self.pnlAPP_Length2.Value = Distance(
                 self.criteria.Approach.Length2)
             self.pnlAPP_Slope2.Value = AngleGradientSlope(
                 self.criteria.Approach.Slope2,
                 AngleGradientSlopeUnits.Percent)
             self.pnlAPP_Length3.Value = Distance(
                 self.criteria.Approach.Length3)
             self.pnlAPP_TotalLength.Value = Distance(
                 self.criteria.Approach.TotalLength)
     self.cmbBL_DistFromTHR.SelectedIndex = 0
     if (self.criteria.BalkedLanding.Enabled):
         self.pnlBL_InnerEdge.Value = Distance(
             self.criteria.BalkedLanding.InnerEdge)
         if (not MathHelper.smethod_97(
                 self.criteria.BalkedLanding.DistFromTHR, 0)):
             self.txtBL_DistFromTHR.Value = Distance(
                 self.criteria.BalkedLanding.DistFromTHR)
             if (not self.criteria.BalkedLanding.DistFromTHRFixed):
                 self.cmbBL_DistFromTHR.SelectedIndex = 1
             else:
                 self.cmbBL_DistFromTHR.SelectedIndex = 2
         else:
             self.cmbBL_DistFromTHR.SelectedIndex = 0
         self.pnlBL_Divergence.Value = AngleGradientSlope(
             self.criteria.BalkedLanding.Divergence,
             AngleGradientSlopeUnits.Percent)
         self.pnlBL_Slope.Value = AngleGradientSlope(
             self.criteria.BalkedLanding.Slope,
             AngleGradientSlopeUnits.Percent)
     if (self.criteria.Conical.Enabled):
         self.pnlCON_Slope.Value = AngleGradientSlope(
             self.criteria.Conical.Slope, AngleGradientSlopeUnits.Percent)
         self.pnlCON_Height.Value = Altitude(self.criteria.Conical.Height)
     if (self.criteria.InnerApproach.Enabled):
         self.pnlIA_Width.Value = Distance(
             self.criteria.InnerApproach.Width)
         self.pnlIA_DistFromTHR.Value = Distance(
             self.criteria.InnerApproach.DistFromTHR)
         self.pnlIA_Length.Value = Distance(
             self.criteria.InnerApproach.Length)
         self.pnlIA_Slope.Value = AngleGradientSlope(
             self.criteria.InnerApproach.Slope,
             AngleGradientSlopeUnits.Percent)
     self.pnlIH_Location.SelectedItem = self.criteria.InnerHorizontal.Location
     self.pnlIH_Height.Value = Altitude(
         self.criteria.InnerHorizontal.Height)
     self.pnlIH_Radius.Value = Distance(
         self.criteria.InnerHorizontal.Radius)
     if (self.criteria.InnerTransitional.Enabled):
         self.pnlIT_Slope.Value = AngleGradientSlope(
             self.criteria.InnerTransitional.Slope,
             AngleGradientSlopeUnits.Percent)
     if (self.criteria.NavigationalAid.Enabled):
         self.pnlNA_Slope.Value = AngleGradientSlope(
             self.criteria.NavigationalAid.Slope,
             AngleGradientSlopeUnits.Percent)
     if (self.criteria.OuterHorizontal.Enabled):
         self.pnlOH_Height.Value = Altitude(
             self.criteria.OuterHorizontal.Height)
         self.pnlOH_Radius.Value = Distance(
             self.criteria.OuterHorizontal.Radius)
     self.pnlS_Width.Value = Distance(self.criteria.Strip.Width)
     self.pnlS_Length.Value = Distance(self.criteria.Strip.Length)
     if (not self.criteria.TakeOff.DistFromENDFixed):
         self.cmbTO_DistFromEND.SelectedIndex = 0
     else:
         self.cmbTO_DistFromEND.SelectedIndex = 1
     if (self.criteria.TakeOff.Enabled):
         self.pnlTO_InnerEdge.Value = Distance(
             self.criteria.TakeOff.InnerEdge)
         self.txtTO_DistFromEND.Value = Distance(
             self.criteria.TakeOff.DistFromEND)
         self.pnlTO_Divergence.Value = AngleGradientSlope(
             self.criteria.TakeOff.Divergence,
             AngleGradientSlopeUnits.Percent)
         self.pnlTO_FinalWidth.Value = Distance(
             self.criteria.TakeOff.FinalWidth)
         self.pnlTO_Length.Value = Distance(self.criteria.TakeOff.Length)
         self.pnlTO_Slope.Value = AngleGradientSlope(
             self.criteria.TakeOff.Slope, AngleGradientSlopeUnits.Percent)
     if (self.criteria.Transitional.Enabled):
         self.pnlT_Slope.Value = AngleGradientSlope(
             self.criteria.Transitional.Slope,
             AngleGradientSlopeUnits.Percent)