Exemplo n.º 1
0
 def method_5(self, bool_0, string_0, string_1):
     position = Position()
     stringBuilder = StringBuilder()
     string_1 = QString(string_1)
     str0 = "qa:{0}".format(string_1.length())
     sAFETYAREAWIDTH = Captions.SAFETY_AREA_WIDTH
     distance = Distance(self.safetyAreaWidth)
     stringBuilder.AppendLine("{0}{1}\t{2}".format(string_0, sAFETYAREAWIDTH, distance.method_0("0.##:m")))
     sAFETYAREALENGTHSTART = Captions.SAFETY_AREA_LENGTH_START
     distance1 = Distance(self.safetyAreaStart)
     stringBuilder.AppendLine("{0}{1}\t{2}".format(string_0, sAFETYAREALENGTHSTART, distance1.method_0("0.##:m")))
     sAFETYAREALENGTHEND = Captions.SAFETY_AREA_LENGTH_END
     distance2 = Distance(self.safetyAreaEnd)
     stringBuilder.AppendLine("{0}{1}\t{2}".format(string_0, sAFETYAREALENGTHEND, distance2.method_0("0.##:m")))
     if (self.method_4(PositionType.START)):
         position = self.method_1(PositionType.START).method_3() if(not bool_0) else self.method_1(PositionType.START).method_2()
         stringBuilder.AppendLine(String.Concat([string_0, position.Type.VariableNames[position.Type - 1]]))
         stringBuilder.AppendLine(position.method_5(str0))
     for position1 in self:
         if (position1.Type != PositionType.Position or not position1.IsValidIncludingAltitude):
             continue
         position = position1.method_3() if(not bool_0) else position1.method_2()
         stringBuilder.AppendLine(String.Concat([string_0, position.Type.VariableNames[position.Type - 1]]))
         stringBuilder.AppendLine(position.method_5(str0))
     if (self.method_4(PositionType.END)):
         position = self.method_1(PositionType.END).method_3() if(not bool_0) else self.method_1(PositionType.END).method_2()
         stringBuilder.AppendLine(String.Concat([string_0, position.Type.VariableNames[position.Type - 1]]))
         stringBuilder.AppendLine(position.method_5(str0))
     if (self.method_4(PositionType.CWY)):
         position = self.method_1(PositionType.CWY).method_3() if(not bool_0) else self.method_1(PositionType.CWY).method_2()
         stringBuilder.AppendLine(String.Concat([string_0, position.Type.VariableNames[position.Type - 1]]))
         stringBuilder.AppendLine(position.method_5(str0))
     return stringBuilder.ToString()
Exemplo n.º 2
0
 def method_8(self, dataStream):
     ####### dataStream must be the instance of QDataStream.
     if not isinstance(dataStream, QDataStream):
         QMessageBox.warning(None, "Warning", "Please use the QDataStream")
         return
     # dataStream.writeInt(len(self.name))
     dataStream.writeQString(QString(self.name))
     # dataStream.writeInt(len(self.des1))
     dataStream.writeQString(QString(self.des1))
     # dataStream.writeInt(len(self.des2))
     dataStream.writeQString(QString(self.des2))
     dataStream.writeInt(len(self))
     # binaryWriter_0.Write(Encoding.Default.GetByteCount(self.name))
     # binaryWriter_0.Write(Encoding.Default.GetBytes(self.name))
     # binaryWriter_0.Write(Encoding.Default.GetByteCount(self.des1))
     # binaryWriter_0.Write(Encoding.Default.GetBytes(self.des1))
     # binaryWriter_0.Write(Encoding.Default.GetByteCount(self.des2))
     # binaryWriter_0.Write(Encoding.Default.GetBytes(self.des2))
     # binaryWriter_0.Write(base.Count)
     for position in self:
         dataStream.writeInt(position.Type)
         dataStream.writeBool(position.IsXY)
         dataStream.writeBool(position.IsValidIncludingAltitude)
         # binaryWriter_0.Write((byte)position.Type)
         # binaryWriter_0.Write(position.IsXY)
         # binaryWriter_0.Write(position.IsValidIncludingAltitude)
         if (not position.IsValidIncludingAltitude):
             continue
         dataStream.writeDouble(position.XLat)
         dataStream.writeDouble(position.YLon)
         dataStream.writeDouble(position.AltitudeValue.Metres)
Exemplo n.º 3
0
    def method_0(self, iwin32Window_0):
        if QFile.exists(RunwayList.fileName):
            fl = QFile.remove(RunwayList.fileName)

            file0 = QFile(RunwayList.fileName)
            file0.open(QIODevice.WriteOnly)

            # f = open(RunwayList.fileName, 'w')
            # file0.flush()
            # file0.close()

        else:
            file0 = QFile(RunwayList.fileName)
            file0.open(QIODevice.WriteOnly)

            # f = open(RunwayList.fileName, 'w')
            # file0.flush()
            # file0.close()

        # file0 = QFile(RunwayList.fileName)
        # file0.open(QIODevice.WriteOnly)
        dataStream = QDataStream(file0)
        dataStream.writeQString(QString("PHXASA"))
        dataStream.writeInt(3)
        dataStream.writeInt(len(self))

        for runway in self:
            runway.method_8(dataStream)
Exemplo n.º 4
0
 def ToString(self, format_0 = None):
     stringBuilder = StringBuilder()
     if format_0 == None:
         format_0 = ""
     if not isinstance(format_0, QString):
         format_0 = String.Str2QString(format_0)
     # if (provider == null)
     # {
     #     provider = CultureInfo.CurrentCulture
     # }
     if (not String.IsNullOrEmpty(format_0)):
         format_0 = format_0.toUpper()
         if (format_0.contains("QA:")):
             format_0 = format_0.replace("QA:", "")
             num = 0
             try:
                 num = int(format_0)
             except:
                 num = 0
             stringBuilder = StringBuilder()
             str0 = ""
             for i in range(num):
                 str0 = QString(String.Concat([str0, " "]))
             if (not String.IsNullOrEmpty(self.id)):
                 stringBuilder.AppendLine("{0}{1}\t{2}".format(str0, Captions.ID, self.id))
             if (not self.xy):
                 lATITUDE = Captions.LATITUDE
                 degree = Degrees.smethod_1(self.xlat)
                 stringBuilder.AppendLine("{0}{1}\t{2}".format(str0, lATITUDE, degree.method_2()))
                 lONGITUDE = Captions.LONGITUDE
                 degree1 = Degrees.smethod_5(self.ylon)
                 stringBuilder.Append("{0}{1}\t{2}".format(str0, lONGITUDE, degree1.method_2()))
             else:
                 stringBuilder.AppendLine("{0}{1}\t{2}".format(str0, Captions.X, str(self.xlat)))#.ToString(Formats.GridXYFormat, provider)))
                 stringBuilder.Append("{0}{1}\t{2}".format(str0, Captions.Y, str(self.ylon)))#.ToString(Formats.GridXYFormat, provider)))
             if (not self.altitude == None):
                 altitude = Altitude(self.altitude)
                 stringBuilder.AppendLine("")
                 aLTITUDE = [str0, Captions.ALTITUDE, altitude.ToString(":m"), altitude.ToString(":ft")]
                 stringBuilder.Append("{0}{1}\t{2} ({3})".format(str0, Captions.ALTITUDE, altitude.ToString(":m"), altitude.ToString(":ft")))
             return stringBuilder.ToString()
     stringBuilder = StringBuilder()
     if (not String.IsNullOrEmpty(self.id)):
         stringBuilder.Append(self.id + ", ")
     if (not self.xy):
         degree2 = Degrees.smethod_1(self.xlat)
         str1 = degree2.method_2()
         degree3 = Degrees.smethod_5(self.ylon)
         stringBuilder.Append(str1 + ", " + degree3.method_2())
     else:
         stringBuilder.Append(str(self.xlat) + ", " + str(self.ylon))
     if (not self.altitude == None):
         altitude1 = Altitude(self.altitude)
         stringBuilder.Append(", {0} ({1})", ", " + altitude1.ToString(":m") + " (" + altitude1.ToString(":ft") + ")")
     return stringBuilder.ToString()
Exemplo n.º 5
0
 def method_6(self, binaryWriter_0):
     if not isinstance(binaryWriter_0, QDataStream):
         QMessageBox.warning(None, "Warning", "Please use the QDataStream")
         return
     binaryWriter_0.writeQString(QString(self.name))
     # binaryWriter_0.Write(Encoding.Default.GetBytes(self.name))
     binaryWriter_0.writeQString(QString(self.des1))
     # binaryWriter_0.Write(Encoding.Default.GetBytes(self.des1))
     binaryWriter_0.writeQString(QString(self.des2))
     # binaryWriter_0.Write(Encoding.Default.GetBytes(self.des2))
     binaryWriter_0.writeDouble(float(self.safetyAreaWidth))
     binaryWriter_0.writeDouble(float(self.safetyAreaStart))
     binaryWriter_0.writeDouble(float(self.safetyAreaEnd))
     binaryWriter_0.writeInt(len(self))
     for position in self:
         binaryWriter_0.writeInt(position.Type)
         binaryWriter_0.writeBool(position.IsXY)
         binaryWriter_0.writeBool(position.IsValidIncludingAltitude)
         if (not position.IsValidIncludingAltitude):
             continue
         binaryWriter_0.writeDouble(position.XLat)
         binaryWriter_0.writeDouble(position.YLon)
         binaryWriter_0.writeDouble(position.AltitudeValue.Metres)
Exemplo n.º 6
0
 def smethod_11(string_0, string_1, string_2):
     if (String.IsNullOrEmpty(string_1)):
         return string_0
     stringBuilder = StringBuilder()
     if not isinstance(string_0, QString):
         string_0 = QString(string_0)
     if not isinstance(string_1, QString):
         string_1 = QString(string_1)
     if not isinstance(string_2, QString):
         string_2 = QString(string_2)
     length = string_1.length()
     num = -1
     num1 = 0
     while (True):
         num = string_0.indexOf(string_1, num + 1)
         if (num < 0):
             break
         stringBuilder.Append(string_0, num1, num - num1)
         stringBuilder.Append(string_2)
         num1 = num + length
     stringBuilder.Append(string_0, num1, string_0.length() - num1)
     return QString(stringBuilder.ToString())
Exemplo n.º 7
0
    def method_0(self, iwin32Window_0):
        if QFile.exists(FatoList.fileName):
            fl = QFile.remove(FatoList.fileName)
            f = open(FatoList.fileName, 'w')
            f.flush()
            f.close()

        else:
            f = open(FatoList.fileName, 'w')
            # f = open("D:/xml/phxasar.txt")
            f.flush()
            f.close()

        file0 = QFile(FatoList.fileName)
        file0.open(QIODevice.WriteOnly)
        dataStream = QDataStream(file0)
        dataStream.writeQString(QString("PHXHSAF"))
        dataStream.writeInt(1)
        dataStream.writeInt(len(self))

        for fato in self:
            fato.method_6(dataStream)
        file0.flush()
        file0.close()
Exemplo n.º 8
0
 def get_FullName(self):
     return QString("{0} {1}{2}".format(QString(self.name).trimmed(), self.des1, self.des2)).trimmed()
Exemplo n.º 9
0
 def get_FullName(self):
     nameStr = String.Str2QString(self.name)
     return QString("{0} {1}{2}".format(nameStr.trimmed(), self.des1,
                                        self.des2)).trimmed()