Fame posee una extensin para desarrollo de aplicaciones con .NET. Recordemos que Fame es un programa para anlisis econmico, financiero y estadstico.
Caracteristicas: La herramienta Fame.NET est contenido en el archivo TimeIQNet31.msi. Algunos components claves de esta versin son: chlitiq.dll timeiq.dll timeiq.xml TiqMarshall.dll Componentes de ensamblado FameLicense.txt fameid.txt nameid.txt Archivos de licencias TestTimeIQInstall.exe Archivo ejecutable La herramienta Fame.NET tiene la siguiente estructura: TimeIQ.NET 3.1 chlitiq.dll timeiq.dll timeiq.xml TiqMarshall.dll Componentes de ensamble readme.html Leame TestTimeIQInstall.exe Utilidad para checar que est bien instalado el TimeIQ TiqInstallActions.exe TiqInstallActions.InstallState Instalador docs TimeIQNET.chm Documentacion API HTML pages images Imagenes. Samples Ejemplos de cdigo Properties Web Archivos para el tutorial web pool.dtd DTD para la configuracion de la conexion. Clases de ejemplo Ver samples.html para obtener mayor informacin
Resumen de los Namespaces Namespace Caractersticas com.fame.timeiq Contiene clases que modelan objetos de datos, incluyendo series de tiempo, series de casos, escalares y listas. com.fame.timeiq.data Contiene clases que proveen representaciones de datos intermedios, los cuales estn entre los objetos primitivos y abstractos de TimeIQ, como por ejemplo RegularSeries y Scalar. com.fame.timeiq.dates Contiene clases para representar y manipular calendarios y fechas. com.fame.timeiq.enterprise.cache Provistas para mantener el cache de los objetos TiqObject usados. com.fame.timeiq.enterprise.connections Contiene clases e interfaces que implementan conexiones con los servidores de tipo FRDB. com.fame.timeiq.formulas Contiene clases que sobrellevan los clculos analticos para evaluar ecuaciones algebraicas. com.fame.timeiq.Functions.date Contiene funciones que realizan calculus de fechas comunmente con periodos de series observadas calendarizadas. com.fame.timeiq.Functions.math Contiene funciones que realizan clculos matemticos. com.fame.timeiq.Functions.operators Contiene funciones aplicadas para los operadores de c# a valores de TiqView. com.fame.timeiq.Functions.stats Contiene funciones para realizar clculos estadsticos. com.fame.timeiq.Functions.strings Contiene funciones para manipular entradas de texto (String inputs) com.fame.timeiq.Functions.util Contiene una variedad de funciones que no concuerdan con alguna categoria en especial, incluye manejo de bases de datos en Fame, funciones de series especficas en Fame, etc. com.fame.timeiq.Functionsupport Contiene clases abstractas que dan soporte a los patrones de clculo de funciones mecnicas. com.fame.timeiq.persistence Contiene clases para leer y escribir en bases de datos utilizando un modelo explcito de read/write. com.fame.timeiq.tools.datamodels Contiene clases que le permiten al usuario definer el modelo de datos para tener un set de TiqViews organizados y accesables.
Funciones TimeIQ
Las capacidades computacionales estan hechas en forma de trabajar como objetos. TimeIQ tiene numerosas funciones para analizar y manipular datos. Las funciones adicionales pueden crear funciones combinadas para crear una funcin compuesta, o crear funciones bastractas que sean parte de TimeIQ. Tipos de funciones Las funciones son categorizadas dependiendo de dos importantes propiedades: 1. El nmero de argumentos de TiqViw de la funcin acepta: Unarios un argumento Binarios dos argumentos Mltiples 2. La forma en que la function negocia con las series observadas: 3
Elemento opera separadamente en cada serie de observacin. Serie Combina varias o todas las observaciones de una seria para producir cada uno de los resultados. Funcin de Namespaces Las funciones TimeIQ estn organizadas de manera que los namespaces dentro de under.fame.timeiq.Functions son: dateClculos de fechas que usualmente tiene periodos calendarizados de series observadas. Math Clculos matemticos. Operators Aplicando los operadores de C# a los valores de TiqView. Stats Clculos estadsticos. String Manipula entradas de datos (String input) Util Funciones que no entran en algna categora en lo especfico, incluyen procedimientos de bases de datos de Fame, funciones especficas y de series. Code FAME TIME IQ Functions Imports com.fame.timeiq Imports com.fame.timeiq.persistence Imports com.fame.timeiq.data Imports com.fame.timeiq.dates
Module FameTimeIqFunctions Private prop As New System.Collections.Specialized.NameValueCollection Public Function GetStringList(ByVal DatabasePath As String, ByVal ListName As String) As List(Of String) Dim ListofVariablesCodes As New List(Of String) Dim db As DataStore Dim con As Connection Dim TiqObject As TiqObject = Nothing Dim resultParameter As String = "" con = Server.Instance.Session.createConnection("") ' create Connection object prop("mode") = "READ" Try db = con.getDataStore(DatabasePath) ' get the DataStore object TiqObject = db.getTiqObjectCopy(ListName) If TiqObject Is Nothing Then Return Nothing End If If TiqObject.hasData Then For Each listElement As String In TiqObject.getObservations.Values.getStringArray ListofVariablesCodes.Add(listElement) Next End If Catch ex As NotFoundChkException End Try con.close() Return ListofVariablesCodes End Function
Public Function GetStringListRemote(ByVal ListName As String) As List(Of String) Dim ListofCountryCodes As New List(Of String) Dim con As Connection Dim TiqObject As TiqObject = Nothing Dim server As Server = server.Instance Dim session As Session = server.Session con = session.createConnection("frdb_m@localhost", "", "") ' connection to server prop("mode") = "READ" TiqObject = con.remEval(ListName) If TiqObject Is Nothing Then Return Nothing End If If TiqObject.hasData Then For Each listElement As String In TiqObject.getObservations.Values.getStringArray ListofCountryCodes.Add(listElement) Next End If con.close() Return ListofCountryCodes End Function
Public Function LoadStringParameter(ByVal databasePath As String, ByVal aParameter As String) As String Dim db As DataStore Dim con As Connection Dim TiqObject As TiqObject = Nothing Dim resultParameter As String = "" con = Server.Instance.Session.createConnection("") ' create Connection object prop("mode") = "READ" db = con.getDataStore(databasePath) ' get the DataStore object Try TiqObject = db.getTiqObjectCopy(aParameter) If TiqObject.hasData Then resultParameter = TiqObject.getTiqValue.ToString End If Catch ex As NotFoundChkException resultParameter = "Not found in " + databasePath End Try db.close() con.close() Return resultParameter End Function Public Function LoadStringAttribut(ByVal aParameter As String, ByVal anAttribut As String) As String Dim db As DataStore Dim con As Connection Dim TiqObject As TiqObject = Nothing Dim resultParameter As String = "" con = Server.Instance.Session.createConnection("") ' create Connection object prop("mode") = "READ" db = con.getDataStore("s:\units\mad\models\forecast\fe.db") ' get the DataStore object Try resultParameter = db.getAttribute(aParameter, anAttribut).Value.ToString Catch ex As NotFoundChkException resultParameter = "Not found in FE.DB" End Try db.close() con.close() Return resultParameter End Function Public Function LoadStringParameter_Case(ByVal databasePath As String, ByVal aParameter As String, ByVal CaseIndex As Integer) As String Dim db As DataStore Dim con As Connection Dim myTiqObject As TiqObject = Nothing Dim resultParameter As String = "" con = Server.Instance.Session.createConnection("") ' create Connection object prop("mode") = "READ" db = con.getDataStore(databasePath) ' get the DataStore object Try myTiqObject = db.getTiqObjectCopy(aParameter) If myTiqObject.hasData Then resultParameter = myTiqObject.getObservation(CaseIndex + 1).StringValue Else resultParameter = "No Data" End If Catch ex As NotFoundChkException resultParameter = "Not found in " + databasePath End Try db.close() con.close() Return resultParameter End Function
Public Function LoadStringParameterRemote(ByVal databasePath As String, ByVal aParameter As String) As String Dim con As Connection Dim TiqObject As TiqObject = Nothing Dim server As Server = server.Instance Dim session As Session = server.Session Dim resultParameter As String = "" con = session.createConnection("frdb_m@localhost", "", "") ' connection to server prop("mode") = "READ" Try TiqObject = con.remEval(databasePath + "'" + aParameter) If TiqObject Is Nothing Then Return Nothing End If resultParameter = TiqObject.getTiqValue.ToString Catch ex As EvaluationChkException End Try con.close() Return resultParameter End Function Public Sub SaveSeriesAs(ByVal ASeries As SupplySeries, ByVal SeriesCode As String, ByVal DatabasePath As String) Dim db As DataStore Dim con As Connection con = Server.Instance.Session.createConnection("") ' create Connection object prop("mode") = "READ_WRITE" db = con.getDataStore(DatabasePath, prop) ' get the DataStore object con.begin() db.overwriteObject(SeriesCode, ASeries.mSeries) ' Write object(s) to database con.commit() db.close() con.close() End Sub Public Function LoadSeries(ByVal DatabaseSource As String, ByVal SeriesCode As String) As TiqObject Dim db As DataStore Dim con As Connection Dim aTiqSeries As TiqObject con = Server.Instance.Session.createConnection("") ' create Connection object prop("mode") = "READ" db = con.getDataStore(DatabaseSource) ' get the DataStore object Try aTiqSeries = db.getTiqObjectCopy(SeriesCode) Catch ex As NotFoundChkException aTiqSeries = New RegularSeries(RegularCalendar.QUARTERLY, RegularCalendar.QUARTERLY) End Try db.close() con.close() Return aTiqSeries End Function End Module
5
VB.NET Cdigo y explicacin Diagrama de Clases
La nueva versin del sistema Supply_Interfaces_HP (tratado en el Informe anterior), hace mejor manejo de las herramientas de Office y de Fame. En primer lugar esta mejor estructurado, se dividi en varias partes, el cdigo es genrico y cumple con varios estndares de programacin, adems de que est programado con objetos (OOP) .
7
Cdigo para llenar las celdas Imports com.fame.timeiq.data
Module UserInteraction
Public Sub Sheet_Changed(ByVal SheetName As String, ByVal Target As Microsoft.Office.Interop.Excel.Range) Select Case SheetName Case Ribbon1.Sheet_Trend_Forecast Case Ribbon1.Sheet_Change_History Call Sheet_changed_Change_history(Target) Case Ribbon1.Sheet_Other_Trend_Infos Case Ribbon1.Sheet_Actual_Forecast Case Else 'do nothing End Select End Sub Public Sub Sheet_Selection_Changed(ByVal SheetName As String, ByVal Target As Microsoft.Office.Interop.Excel.Range) Select Case SheetName Case Ribbon1.Sheet_Trend_Forecast Call Sheet_selection_changed_Trend_Forecast(Target) Case Ribbon1.Sheet_Change_History
Case Ribbon1.Sheet_Other_Trend_Infos Case Ribbon1.Sheet_Actual_Forecast Case Else 'do nothing End Select End Sub
Public Sub Sheet_changed_Change_history(ByVal Target As Microsoft.Office.Interop.Excel.Range) Dim startRow = 15 Dim CaseSerieIndex As Integer Dim values As ArrayAdapter Dim myWorkbook As Supply.ThisWorkbook Dim mySheet As Excel.Worksheet myWorkbook = Globals.ThisWorkbook mySheet = myWorkbook.Worksheets(Ribbon1.Sheet_Change_History) 'turn off event handler to avoid useless call to Sheet_changed for clearing or updating the sheet from within this sub myWorkbook.Application.EnableEvents = False Globals.ThisWorkbook.Application.ScreenUpdating = False Select Case Target.Column Case 4 'Constraint type ' how to check if this is really a cell related to a supply variable constraint ? If Globals.Ribbons.Ribbon1.mySession.referenceListOfVariable.Contains(Target.Offset(0, -2).Text) Then CaseSerieIndex = Target.Offset(0, -3).Value ' Clear what was on the sheet ' this is not a nice way of doing it as it uses hard coded rows 10 to 20 ' A solution to find out what is really needed to clean is to find mySheet.Range(mySheet.Rows(startRow), mySheet.Rows(25)).Clear() Select Case Target.Text Case "Level Constraint" mySheet.Cells(startRow, 3).value = "Start" mySheet.Cells(startRow, 4).value = Globals.Ribbons.Ribbon1.mySession.ActiveSeries.StartConstraint mySheet.Cells(startRow + 1, 3).value = "End" mySheet.Cells(startRow + 1, 4).value = Globals.Ribbons.Ribbon1.mySession.ActiveSeries.EndConstraint
' Time range (Famedate) mySheet.Range(mySheet.Cells(startRow + 3, 4), mySheet.Cells(startRow + 3, values.Count + 4)).Value = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex).mConstraintSeries.getObservations.getIndexesAsStrings
' Weights = <cou>.<var>.constraint.weights = mConstraintWeightsSeries values = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex).mConstraintWeightsSeries.getObservations.Values mySheet.Cells(startRow + 5, 3) = "Weights" mySheet.Range(mySheet.Cells(startRow + 5, 4), mySheet.Cells(startRow + 5, values.Count + 4)).Value = values.DoubleArray Case "No Constraint" Case "Growth Constraint" Case Else MsgBox("Invalide Constraint", MsgBoxStyle.Critical) ' revert to previous value 'Target.Value = Globals.Ribbons.Ribbon1.mySession.ActiveSeries.Constraints End Select End If Case 5 ' Case Else 'do nothing End Select Globals.ThisWorkbook.Application.EnableEvents = True Globals.ThisWorkbook.Application.ScreenUpdating = True End Sub
Public Sub Sheet_selection_changed_Trend_Forecast(ByVal Target As Microsoft.Office.Interop.Excel.Range) Dim startRow = 15 Dim CaseSerieIndex As Integer Dim values As ArrayAdapter ' myWorkbook and mySheet are shortcust to fully qualified objects. Make the text more easy to read Dim myWorkbook As Supply.ThisWorkbook Dim mySheet As Excel.Worksheet myWorkbook = Globals.ThisWorkbook mySheet = myWorkbook.Worksheets(Ribbon1.Sheet_Trend_Forecast)
'turn off event handler to avoid useless call to Sheet_changed for clearing or updating the sheet from within this sub myWorkbook.Application.EnableEvents = False Globals.ThisWorkbook.Application.ScreenUpdating = False CaseSerieIndex = mySheet.Cells(Target.Row, 1).Value Select Case Target.Row Case 4 To 4 + Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables.Count ' Clear what was on the sheet ' this is not a nice way of doing it as it uses hard coded rows 10 to 20 ' A solution to find out what is really needed to clean is to find mySheet.Range(mySheet.Rows(startRow), mySheet.Rows(25)).Clear()
' display the historical data
' hist mySheet.Cells(startRow + 4, 4) = "Historical data" Globals.Ribbons.Ribbon1.mySession.ActiveSeries = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex) Globals.Ribbons.Ribbon1.DropDown_CountryVariables.SelectedItemIndex = CaseSerieIndex ' 'Some countries crash in the line below. 'Null Reference Exeption on: '''''''CHL, EST, ISR, PRT, and SVN (Maybe because we are using old databases?) 'Argument Out Of Range Exception on: '''''''MEX, CZE, ISL, KOR, SVK--> POPT '''''''BEL, SWE, USA, ESP, FIN, ITA--> CLFS '''''''CHE --> ENRS '''''''AUT --> KTVS '''''''CZE, ISL, KOR, MEX, SVK --> TRPDTY ' If we only add a catch NullReferenceException it will crash in the next line throwing NullReferenceException. '
' End of historical estimation mySheet.Cells(startRow + 7, 4) = "End of historical estimation" ' this is empty but it should not mySheet.Cells(startRow + 7, 5) = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex).EndHistoricalEstimation
mySheet.Cells(startRow + 13, 4) = "Speed of Interpolation"
'I put a comment here because we have to know the difference between the speed and the demographic source. 'mySheet.Cells(startRow + 13, 5) = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex).TypefSelect2
' Final growth rate for interpolation mySheet.Cells(startRow + 14, 4) = "Final growth rate for interpolation" mySheet.Cells(startRow + 14, 5) = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex).TypefSelect3
' Start of Extrapolation mySheet.Cells(startRow + 15, 4) = "Start of Extrapolation" mySheet.Cells(startRow + 15, 5) = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex).CountryCode ' just to put something
' End of Extrapolation mySheet.Cells(startRow + 16, 4) = "End of Extrapolation" mySheet.Cells(startRow + 16, 5) = Globals.Ribbons.Ribbon1.mySession.ActiveCountry.SupplyVariables(CaseSerieIndex).CountryCode ' just to put something
Case Else 'do nothing End Select Globals.ThisWorkbook.Application.EnableEvents = True Globals.ThisWorkbook.Application.ScreenUpdating = True End Sub End Module
Cdigo del Ribbon Imports Microsoft.Office.Tools.Ribbon Imports Microsoft.Office.Interop.Excel Imports com.fame.timeiq.data
Public Class Ribbon1 Public mySession As New SupplySession Public Const Sheet_Trend_Forecast = "Trend Forecasts" Public Const Sheet_Change_History = "Change History" Public Const Sheet_Other_Trend_Infos = "Other Trend Infos" Public Const Sheet_Actual_Forecast = "Actual Forecast" Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load Me.Label_ParamDatabase.Label = mySession.ParamDatabasePath Me.Label_SupplyHistoricalDatabase.Label = mySession.SupplyHistoricalDatabasePath Me.EditBox_EndMTB.Text = mySession.EndMTB Call Fill_DropDownCountry(mySession.GetListOfCountryCodes) Call Fill_DropDownReferenceVariable(mySession.referenceListOfVariable) Call SetupExcelWorkbook() End Sub Private Sub Fill_DropDownCountry(ByVal ACountryCodeList As List(Of String))
With Me.DropDown_Country .Items.Clear() Dim myRibbonItem As RibbonDropDownItem myRibbonItem = Factory.CreateRibbonDropDownItem() myRibbonItem.Label = "" .Items.Add(myRibbonItem) For Each strCountry As String In ACountryCodeList myRibbonItem = Factory.CreateRibbonDropDownItem() myRibbonItem.Label = strCountry .Items.Add(myRibbonItem) Next End With End Sub Private Sub Fill_DropDownReferenceVariable(ByVal aList As List(Of String))
With Me.DropDown_ReferenceVariables .Items.Clear() Dim myRibbonItem As RibbonDropDownItem myRibbonItem = Factory.CreateRibbonDropDownItem() For Each strElement As String In aList myRibbonItem = Factory.CreateRibbonDropDownItem() myRibbonItem.Label = strElement .Items.Add(myRibbonItem) Next End With End Sub Private Sub Fill_DropDownCountryVariable(ByVal aList As List(Of String))
With Me.DropDown_CountryVariables .Items.Clear() Dim myRibbonItem As RibbonDropDownItem For Each strElement As String In aList myRibbonItem = Factory.CreateRibbonDropDownItem() myRibbonItem.Label = strElement .Items.Add(myRibbonItem) Next End With Try mySession.ActiveSeries = mySession.ActiveCountry.SupplyVariables(0) Catch ex As ArgumentOutOfRangeException MsgBox("No Variable defined for " + mySession.ActiveCountry.Code) End Try End Sub Private Sub Button_Form_Show_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button_Form_Show.Click 'mySession.ActiveSeries = Me.DropDown_CountryVariables.SelectedItem.Label Dim myForm As New SupplySeriesForm() myForm.LoadSeries(mySession.ActiveSeries) myForm.RefreshForm() myForm.Show() End Sub Private Sub Button_Form_Country_Show_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button_Form_Country_Show.Click Dim myForm As New SupplyCountryForm() myForm.RefreshForm(mySession.ActiveCountry) myForm.Show() End Sub Private Sub DropDown_Country_SelectionChanged(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles DropDown_Country.SelectionChanged mySession.ActiveCountry = New SupplyCountries(CType(sender, RibbonDropDown).SelectedItem.Label) mySession.ActiveCountry.LoadCountryParameters(mySession.ParamDatabasePath) mySession.ActiveCountry.LoadSeriesList(mySession.ParamDatabasePath, mySession.referenceListOfVariable) Fill_DropDownCountryVariable(mySession.ActiveCountry.mVariableList) If DropDown_CountryVariables.Items.Count > 0 Then DropDown_CountryVariables.Enabled = True Me.Button_ToExcel.Enabled = True Button_Form_Show.Enabled = True Else DropDown_CountryVariables.Enabled = False Me.Button_ToExcel.Enabled = False Button_Form_Show.Enabled = False End If
Me.Button_Form_Country_Show.Enabled = True
Call Fill_Trend_Forecast_Sheet() Call Fill_Change_history_Sheet() Call Fill_Other_Trend_Infos() Call Fill_Actual_Forecast() End Sub Private Sub DropDown_CountryVariables_SelectionChanged(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles DropDown_CountryVariables.SelectionChanged mySession.ActiveSeries = mySession.ActiveCountry.SupplyVariables(CType(sender, RibbonDropDown).SelectedItemIndex) End Sub
Private Sub Button_ToExcel_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button_ToExcel.Click Dim mySheet As Excel.Worksheet = Globals.ThisWorkbook.Sheets(Sheet_Trend_Forecast) mySheet.UsedRange.ClearContents()
Dim values As ArrayAdapter values = mySession.ActiveSeries.mSupplyHistoricalSeries.getObservations.Values mySheet.Cells(2, 1) = "Historical Data" mySheet.Range(mySheet.Cells(2, 2), mySheet.Cells(2, values.Count + 1)).Value = values.DoubleArray mySheet.Range(mySheet.Cells(1, 2), mySheet.Cells(1, values.Count + 1)).Value = mySession.ActiveSeries.mSeries.getObservations.getIndexesAsStrings values = mySession.ActiveSeries.mSupplyHistoricalDiffSeries.getObservations.Values mySheet.Cells(3, 1) = mySession.ActiveSeries.Splice mySheet.Range(mySheet.Cells(3, 2), mySheet.Cells(3, values.Count + 1)).Value = values.DoubleArray mySheet.Range(mySheet.Columns(4), mySheet.Columns(5)).EntireColumn.AutoFit() End Sub Private Sub SetupExcelWorkbook() 'Dim mySheet As Excel.Worksheet = Globals.ThisWorkbook.Sheets(1) Globals.ThisWorkbook.Sheets(1).Name = "Trend Forecasts" Globals.ThisWorkbook.Sheets(2).Name = "Change History" Globals.ThisWorkbook.Sheets(3).Name = "Other Trend Infos" Globals.ThisWorkbook.Sheets.Add(, Globals.ThisWorkbook.Sheets(3)) Globals.ThisWorkbook.ActiveSheet.Name = "Actual Forecast" Globals.ThisWorkbook.Sheets("Trend Forecasts").activate() End Sub Private Sub Fill_Change_history_Sheet() Globals.ThisWorkbook.Application.EnableEvents = False Globals.ThisWorkbook.Application.ScreenUpdating = False 11
Dim mySheet As Excel.Worksheet = Globals.ThisWorkbook.Sheets(Sheet_Change_History) mySheet.UsedRange.ClearContents() Dim myRow As Integer = 4
For Each myVariable As SupplySeries In mySession.ActiveCountry.SupplyVariables mySheet.Cells(myRow, 1) = myRow - 4 mySheet.Cells(myRow, 2) = myVariable.Code mySheet.Cells(myRow, 3) = myVariable.English mySheet.Cells(myRow, 4) = myVariable.Constraints 'the validation should be emptied for a new use, because only one add() call is allowed. It has to be deleted first or modified mySheet.Cells(myRow, 4).validation.delete() mySheet.Cells(myRow, 4).validation.add(Excel.XlDVType.xlValidateList, Excel.XlDVAlertStyle.xlValidAlertInformation, Excel.XlFormatConditionOperator.xlEqual, "No Constraint,Level Constraint,Growth Constraint") mySheet.Cells(myRow, 5) = myVariable.Estimation myRow = myRow + 1 Next mySheet.Range(mySheet.Columns(1), mySheet.Columns(5)).EntireColumn.AutoFit() Globals.ThisWorkbook.Application.EnableEvents = True Globals.ThisWorkbook.Application.ScreenUpdating = True
End Sub Private Sub Fill_Trend_Forecast_Sheet() Globals.ThisWorkbook.Application.EnableEvents = False Globals.ThisWorkbook.Application.ScreenUpdating = False
Dim mySheet As Excel.Worksheet = Globals.ThisWorkbook.Sheets(Sheet_Trend_Forecast) mySheet.UsedRange.ClearContents() Dim myRow As Integer = 4
For Each myVariable As SupplySeries In mySession.ActiveCountry.SupplyVariables mySheet.Cells(myRow, 1) = myRow - 4 mySheet.Cells(myRow, 2) = myVariable.Code mySheet.Cells(myRow, 3) = myVariable.English myRow = myRow + 1 Next mySheet.Range(mySheet.Columns(1), mySheet.Columns(5)).EntireColumn.AutoFit()
End Sub '---------------------------------Other Trend Infos Sheet------------------------------------- Private Sub Fill_Other_Trend_Infos() Globals.ThisWorkbook.Application.EnableEvents = False Globals.ThisWorkbook.Application.ScreenUpdating = False
Dim mySheet As Excel.Worksheet = Globals.ThisWorkbook.Sheets(Sheet_Other_Trend_Infos) mySheet.UsedRange.ClearContents() Dim myRow As Integer = 4 For Each myVariable As SupplySeries In mySession.ActiveCountry.SupplyVariables mySheet.Cells(myRow, 1) = myVariable.Code mySheet.Cells(myRow, 2) = myVariable.English mySheet.Cells(myRow, 3) = myVariable.Estimated mySheet.Cells(myRow, 4) = myVariable.Info mySheet.Cells(myRow, 5) = myVariable.Marcet_Ravn myRow = myRow + 1 Next mySheet.Range(mySheet.Columns(1), mySheet.Columns(5)).EntireColumn.AutoFit() Globals.ThisWorkbook.Application.EnableEvents = True Globals.ThisWorkbook.Application.ScreenUpdating = True
End Sub '---------------------------------Actual Forecast------------------------------------- Private Sub Fill_Actual_Forecast() Globals.ThisWorkbook.Application.EnableEvents = False Globals.ThisWorkbook.Application.ScreenUpdating = False
Dim mySheet As Excel.Worksheet = Globals.ThisWorkbook.Sheets(Sheet_Actual_Forecast) mySheet.UsedRange.ClearContents() Dim myRow As Integer = 4 For Each myVariable As SupplySeries In mySession.ActiveCountry.SupplyVariables mySheet.Cells(myRow, 1) = myVariable.Code mySheet.Cells(myRow, 2) = myVariable.English mySheet.Cells(myRow, 3) = myVariable.Extrapolate mySheet.Cells(myRow, 4) = myVariable.ExtrapolateObjective mySheet.Cells(myRow, 5) = myVariable.ExtrapolateObjectiveOld myRow = myRow + 1 Next mySheet.Range(mySheet.Columns(1), mySheet.Columns(5)).EntireColumn.AutoFit() Globals.ThisWorkbook.Application.EnableEvents = True Globals.ThisWorkbook.Application.ScreenUpdating = True
End Sub End Class
13
Codigo de la clase Supply Serires, getters y setters de los parmetros de la base de datos. Imports com.fame.timeiq Imports com.fame.timeiq.persistence Imports com.fame.timeiq.data
Public Class SupplySeries Private mCountryCode As String Public Property CountryCode() As String Get Return mCountryCode End Get Set(ByVal value As String) mCountryCode = value End Set End Property
''' <remarks>variable</remarks> Private mCode As String Public Property Code() As String Get Return mCode End Get Set(ByVal value As String) mCode = value End Set End Property
'This should be deleted as soon as the underlying Fame Case series are replaced with regular , individual objects Private mCaseIndex As Integer Public Property CaseIndex() As Integer Get Return mCaseIndex End Get Set(ByVal value As Integer) mCaseIndex = value End Set End Property
''' <remarks>FE_ENGLISH</remarks> Private mEnglish As String Public Property English() As String Get Return mEnglish End Get Set(ByVal value As String) mEnglish = value End Set End Property
Private mEndHistoricalEstimation As String Public Property EndHistoricalEstimation() As String Get Return mEndHistoricalEstimation End Get Set(ByVal value As String) mEndHistoricalEstimation = value End Set End Property
Private mSplicingMethod As String Public Property SplicingMethod() As String Get Return mSplicingMethod End Get Set(ByVal value As String) mSplicingMethod = value End Set End Property
Private mForecastSource As String Public Property ForecastSource() As String Get Return mForecastSource End Get Set(ByVal value As String) mForecastSource = value End Set End Property
Private mForecastDatabase As String Public Property ForecastDatabase() As String Get Return mForecastDatabase End Get Set(ByVal value As String) mForecastDatabase = value End Set End Property
Private mEstimated As Boolean Public Property Estimated() As Boolean Get Return mEstimated End Get Set(ByVal value As Boolean) mEstimated = value End Set End Property
Private mTrendParameter As Integer Public Property TrendParameter() As Integer Get Return mTrendParameter End Get Set(ByVal value As Integer) mTrendParameter = value End Set End Property
Private mDatabaseSource As String Public Property DatabaseSource() As String Get Return mDatabaseSource End Get Set(ByVal value As String) mDatabaseSource = value End Set End Property
Private mLastModified As String Public ReadOnly Property LastModified() As String Get Return mLastModified End Get End Property
Public mSeries As TiqObject = Nothing ''' <summary> ''' Time Series used as one of the QLRX (HP filter) fame function. ''' </summary> ''' <remarks>path in vba, cou.var.constraint in param db</remarks> Public mConstraintSeries As TiqObject = Nothing ''' <summary> ''' Time Series used as one of the QLRX (HP filter) fame procedure ''' </summary> ''' <remarks>weights in vba, cou.var.constraint.weights in param db</remarks> Public mConstraintWeightsSeries As TiqObject = Nothing Public mExtrapolSeries As TiqObject = Nothing Public mExtrapolDiffSeries As TiqObject = Nothing Public mSupplyHistoricalSeries As TiqObject = Nothing Public mSupplyHistoricalDiffSeries As TiqObject = Nothing
''' <remarks>strLastHist | lastvale(histq'cou.var)</remarks> Private mLastHist As String Public Property LastHist() As String Get 15
Return mLastHist End Get Set(ByVal value As String) mLastHist = value End Set End Property
' FormerSeries is the EO series so checks and comparaisons can be done. Public mFormerSeries As TiqObject = Nothing Public mFormerDiffSeries As TiqObject = Nothing ' This is not good. The database path should be stored instead Private mADBEO As Boolean Public Property ADBEO() As Boolean Get Return mADBEO End Get Set(ByVal value As Boolean) mADBEO = value End Set End Property
Private mEstimation As Boolean Public Property Estimation() As Boolean Get Return mEstimation End Get Set(ByVal value As Boolean) mEstimation = value End Set End Property
Private mExtrapolate As String Public Property Extrapolate() As String Get Return mExtrapolate End Get Set(ByVal value As String) mExtrapolate = value End Set End Property
Private mExtrapolateObjective As String 'Making change form DOUBLE TO STRING-------------------------------------------------------Attention Public Property ExtrapolateObjective() As String Get Return mExtrapolateObjective End Get Set(ByVal value As String) mExtrapolateObjective = value End Set End Property 'Same Here making change from DOUBLE to STRING-------------------------------------------------------Attention Private mExtrapolateObjectiveOld As String Public Property ExtrapolateObjectiveOld() As String Get Return mExtrapolateObjectiveOld End Get Set(ByVal value As String) mExtrapolateObjectiveOld = value End Set End Property
Private mTypeExtrapol As String Public Property TypeExtrapol() As String Get Return mTypeExtrapol End Get Set(ByVal value As String) mTypeExtrapol = value End Set End Property
Private mTypef As String Public Property Typef() As String Get Return mTypef End Get Set(ByVal value As String) mTypef = value End Set End Property
Private mTypefSelect As String Public Property TypefSelect() As String Get Return mTypefSelect End Get Set(ByVal value As String) mTypefSelect = value End Set End Property
Private mTypefSelect2 As String Public Property TypefSelect2() As String Get Return mTypefSelect2 End Get Set(ByVal value As String) mTypefSelect2 = value End Set End Property
Private mTypefSelect3 As String Public Property TypefSelect3() As String Get Return mTypefSelect3 End Get Set(ByVal value As String) mTypefSelect3 = value End Set End Property
' This should probably have a better explicte name and be splitted as it both store Lambas and cohort info Private mInfo As String Public Property Info() As String Get Return mInfo End Get Set(ByVal value As String) mInfo = value End Set End Property
Private mList As Boolean Public Property List() As Boolean Get Return mList End Get Set(ByVal value As Boolean) mList = value End Set End Property
Private mMarcet_Ravn As Double Public Property Marcet_Ravn() As Double Get Return mMarcet_Ravn End Get Set(ByVal value As Double) mMarcet_Ravn = value End Set End Property
Private mParam1 As Double Public Property Param1() As Double Get Return mParam1 End Get Set(ByVal value As Double) mParam1 = value End Set End Property
Private mParam2 As Double Public Property Param2() As Double Get Return mParam2 End Get Set(ByVal value As Double) mParam2 = value End Set End Property
Private mConstraints As String Public Property Constraints() As String Get Return mConstraints End Get Set(ByVal value As String) mConstraints = value End Set End Property
Private mStartConstraint As String Public Property StartConstraint() As String Get Return mStartConstraint End Get Set(ByVal value As String) mStartConstraint = value End Set End Property
Private mEndConstraint As String Public Property EndConstraint() As String Get Return mEndConstraint End Get Set(ByVal value As String) mEndConstraint = value End Set End Property
'
Private mStartExtrapolation As String Public Property StartExtrapolation() As String Get Return mStartExtrapolation End Get Set(ByVal value As String) mStartExtrapolation = value End Set End Property
Private mEndExtrapolation As String Public Property EndExtrapolation() As String Get Return mEndExtrapolation End Get Set(ByVal value As String) mEndExtrapolation = value End Set End Property
17
Private mSplice As String Public Property Splice() As String Get Return mSplice End Get Set(ByVal value As String) mSplice = value End Set End Property
Public Sub LoadSeriesValues() mSeries = FameTimeIqFunctions.LoadSeries(Me.DatabaseSource, Me.CountryCode + "." + Me.Code) If mSeries.isSeries() Then mLastModified = Me.mSeries.ObjectInfo.getModificationDate.ToString End If mSupplyHistoricalSeries = FameTimeIqFunctions.LoadSeries("c:\fame\Supply_datahist.db", Me.CountryCode + "." + Me.Code) LastHist = mSupplyHistoricalSeries.getCalendar.indexToString(mSupplyHistoricalSeries.getObservations.Count) If Me.Splice = "growth" Then Dim diff As com.fame.timeiq.Functions.stats.Pct = New Functions.stats.Pct(mSupplyHistoricalSeries) mSupplyHistoricalDiffSeries = diff.getTiqObjectCopy Else Dim diff As com.fame.timeiq.Functions.stats.Diff = New Functions.stats.Diff(mSupplyHistoricalSeries) mSupplyHistoricalDiffSeries = diff.getTiqObjectCopy End If mConstraintSeries = FameTimeIqFunctions.LoadSeries("c:\fame\Supply_parameters.db", Me.CountryCode + "." + Me.Code + ".constraint") mConstraintWeightsSeries = FameTimeIqFunctions.LoadSeries("c:\fame\Supply_parameters.db", Me.CountryCode + "." + Me.Code + ".constraint.weights") mExtrapolSeries = FameTimeIqFunctions.LoadSeries("c:\fame\Supply_parameters.db", Me.CountryCode + "." + Me.Code + ".extrapol") If Me.Splice = "growth" Then Dim diff As com.fame.timeiq.Functions.stats.Pct = New Functions.stats.Pct(mExtrapolSeries) mExtrapolDiffSeries = diff.getTiqObjectCopy Else Dim diff As com.fame.timeiq.Functions.stats.Diff = New Functions.stats.Diff(mExtrapolSeries) mExtrapolDiffSeries = diff.getTiqObjectCopy End If mFormerSeries = FameTimeIqFunctions.LoadSeries("c:\fame\Supply_parameters.db", Me.CountryCode + "." + Me.Code + ".extrapol") If Me.Splice = "growth" Then Dim diff As com.fame.timeiq.Functions.stats.Pct = New Functions.stats.Pct(mFormerSeries) mFormerDiffSeries = diff.getTiqObjectCopy Else Dim diff As com.fame.timeiq.Functions.stats.Diff = New Functions.stats.Diff(mFormerSeries) mFormerDiffSeries = diff.getTiqObjectCopy End If
End Sub Public Sub SaveSeriesAs(ByVal SeriesCode As String, ByVal DatabasePath As String) Call FameTimeIqFunctions.SaveSeriesAs(Me, SeriesCode, DatabasePath) End Sub Public Sub New(ByVal SeriesCode As String) Me.Code = SeriesCode End Sub Public Sub New()
End Sub End Class
Imports com.fame.timeiq Imports com.fame.timeiq.persistence Imports com.fame.timeiq.data Public Class SupplyCountries Private mCode As String Public Property Code() As String Get Return mCode End Get Set(ByVal value As String) mCode = value End Set End Property
'Full or simplified : WEA vs. SMP ' not sure if it is really needed as this can be deduced from series availability--> I think this also... Private Type As String
Private mADBLastIntegrationDate As String Public Property ADBLastIntegrationDate() As String Get Return mADBLastIntegrationDate End Get Set(ByVal value As String) mADBLastIntegrationDate = value End Set End Property
Private mDeskLastSubmitDate As String Public Property DeskLastSubmitDate() As String Get Return mDeskLastSubmitDate End Get Set(ByVal value As String) mDeskLastSubmitDate = value End Set End Property
Private mSupplyLastIntegrationDate As String Public Property SupplyLastIntegrationDate() As String Get Return mSupplyLastIntegrationDate End Get Set(ByVal value As String) mSupplyLastIntegrationDate = value End Set End Property
Public SupplyVariables As New List(Of SupplySeries)
Private mADBEO As String Public Property ADBEO() As String Get Return mADBEO End Get Set(ByVal value As String) mADBEO = value End Set End Property
Private mFilePathADB As String Public Property FilePathADB() As String Get Return mFilePathADB End Get Set(ByVal value As String) 19
mFilePathADB = value End Set End Property
Private mFilePathEO As String Public Property FilePathEO() As String Get Return mFilePathEO End Get Set(ByVal value As String) mFilePathEO = value End Set End Property
Private mFilePathMTB As String Public Property FilePathMTB() As String Get Return mFilePathMTB End Get Set(ByVal value As String) mFilePathMTB = value End Set End Property
Private mFilePathRef As String Public Property FilePathRef() As String Get Return mFilePathRef End Get Set(ByVal value As String) mFilePathRef = value End Set End Property
Private mIsOpen As String Public Property Isopen() As String Get Return mIsOpen End Get Set(ByVal value As String) mIsOpen = value End Set End Property
Public mVariableList As New List(Of String)
Public Sub New(ByVal aCountryCode As String) mCode = aCountryCode End Sub Public Sub LoadCountryParameters(ByVal ParamDatabasePath As String) FilePathADB = LoadStringParameter(ParamDatabasePath, Me.Code + ".filepathADB") FilePathEO = LoadStringParameter(ParamDatabasePath, Me.Code + ".filepatheo") FilePathMTB = LoadStringParameter(ParamDatabasePath, Me.Code + ".filepathmtb") Isopen = LoadStringParameterRemote("adb_eostatus", Me.Code + ".open") ADBEO = LoadStringParameter(ParamDatabasePath, Me.Code + ".ADBEO") ADBLastIntegrationDate = LoadStringParameterRemote("adb_eostatus", Me.Code + ".last_integre") DeskLastSubmitDate = LoadStringParameterRemote("adb_eostatus", Me.Code + ".last_submit") SupplyLastIntegrationDate = LoadStringParameter(ParamDatabasePath, Me.Code + ".LAST_INTEGRE_SUPPLY") FilePathRef = LoadStringParameter(ParamDatabasePath, Me.Code + ".filepathref") End Sub Public Sub LoadSeriesList(ByVal ParamDatabasePath As String, ByVal RefList As List(Of String)) Dim aListOfSeries As New List(Of SupplySeries) Dim index As Integer = 0
Me.mVariableList.Clear() Dim ASupplyVariable As SupplySeries For Each variable As String In GetStringList(ParamDatabasePath, Me.Code + ".list")
If UCase(variable) = "TRUE" Then Me.mVariableList.Add(RefList.Item(index)) ASupplyVariable = New SupplySeries(RefList.Item(index)) ASupplyVariable.CountryCode = Me.Code ASupplyVariable.CaseIndex = RefList.IndexOf(ASupplyVariable.Code) ASupplyVariable.loadSeriesParameters(ParamDatabasePath) ASupplyVariable.LoadSeriesValues() SupplyVariables.Add(ASupplyVariable) End If index = index + 1 Next
End Sub End Class
Conexin con el servidor
VisualSVN
VisualSVN is a Visual Studio plug-in that integrates Subversion and TortoiseSVN seamlessly with Visual Studio. VisualSVN virtually eliminates the management of your project source code files within Subversion. Program, design, debug and deploy with VisualSVN as your silent partner that safeguards your source code. With VisualSVN deployed throughout your development organization, all of your developers will be using Subversion confidently and effectively to manage and safeguard your organization's work product.
Why You Should Use VisualSVN Ease of use: VisualSVN makes Subversion substantially easier to use within Visual Studio than using TortoiseSVN alone with Subversion. Deep integration of Visual Studio projects and solutions with Subversion file management. You don't have to think about Subversion when you work with files and projects in Visual Studio. More stable, simpler and easier to use, and more reliable than available open source alternatives (according to independent reviewers and bloggers). 21
One-stop source control lets you perform all user level Subversion functions manage project files, checkout, commit, and other operations within Visual Studio. Compatible with the latest Subversion and TortoiseSVN releases. Continually updated. Inexpensive to purchase, and easy to set up. Quick and Easy Adoption One-click import of a new solution: the Add Solution to Subversion wizard gets you started quickly and reliably. With one simple step, your solution is placed under Subversion source control. One-click checkout: the Get Solution from Subversion dialog makes checkout quick and painless. Developers instantly get to work on shared projects. Fully TortoiseSVN integrated: all source control functions use the standard TortoiseSVN dialogs. Your knowledge of TortoiseSVN is immediately useful. Fully compatible: VisualSVN contains the most current available Subversion distributions plus the original command line binaries (including svn.exe). Watch the quick Getting Started demo and learn how easy Subversion can be. Transparent Source Control That Covers You At All Times Automatically adds every created item to Subversion. No ignore/exclude patterns to manage: Visual Studio temporary files such as the contents of obj and bin folders are ignored by default when using VisualSVN. Transparently move/rename your files and folders (and the complete history of these changes will be preserved by Subversion). Common file operations are transparently reflected to Subversion: Drag & Drop, Copy & Paste and Save As all cause the right thing to happen within version control. Traffic-light style Subversion visual status is displayed for every versioned item in the Solution Explorer. Status display is displayed in the status bar at all times with a traffic light style visual indicator, so that you instantly know if files have changed. Avoid dirty commits and keep your work grouped logically as you commit your changes. Unique Features That Enhance Your Productivity Quick Diff marks changes visually within Visual Studio using color coding. You can see the changes in your source file from the repository version at a glance. There is fast navigation available to move to the next changed section. You never have to open a separate diff window to see what you have changed. And you don't have to hunt for changes. Quick Revert uses the Quick Diff color coding to allow you to easily restore changes that have been made from the repository version. Just select the changes that are displayed by Quick Diff and perform Revert Selection. Quick Revert is fully integrated with the Visual Studio Undo/Redo stack. Track and manage all changes made to your source file by using the unique visual assists that are provided by VisualSVN. You are free to use external applications and you will always see exactly what has changed. Never make a dirty commit again. Seamless integration with built-in and third-party refactoring tools such as ReSharper. Source code changes and file operations such as renaming are handled for you and are reflected transparently to Subversion by VisualSVN. Even changes in more complex objects such as forms and ASPX pages are handled transparently by VisualSVN and are accurately reflected to Subversion.
Version control with VisualSVN is user friendly and straightforward. You don't need to have prior Subversion experience. Add Solution to Subversion First you need to place your solution under Subversion control. There are only two main steps to do this: execute the Add Solution to Subversion command and commit your solution to the repository. Open or create new solution in Visual Studio. Then choose Add Solution to Subversion from the VisualSVN menu command and the wizard will open. 23
Now you choose the directory where your code will be stored. VisualSVN can add your code to a new or an existing repository. When VisualSVN creates new repository it creates the default repository structure with branches, tags and trunk folders. Initially your code will be stored in the trunk folder. Please note that when adding your code to an existing repository you can choose any remote repository. For example, you can easily add your solution to a hosted repository provided by services like Google Code. Just enter the repository URL in the corresponding field in the dialog.
After this operation is finished all source files and folders in your solution will be marked as added to Subversion. Added files will be indicated by yellow icons in Solution Explorer. But all changes are still local and have not been sent to the target repository yet. This allows you to review the results of adding your solution to Subversion before the operation is finished. Commit Solution to Subversion Although files in your solution are marked as added to Subversion they still are not committed. Only your local working copy is affected and files are not transferred to the repository.
To commit your solution to Subversion, select VisualSVN | Commit menu item, enter a comment and click OK. The first versions of your source files will be sent to the target Subversion repository.
After you committed your solution to Subversion you should see green icons in Solutions Explorer indicating that your code is controlled by Subversion and you have no local changes. You are ready to work! Basic Work Cycle VisualSVN has numerous features, but on a day-to-day basis you will use only a few of them. In this section we'll describe the most common things that you might find yourself doing with VisualSVN in the course of a day's work. The typical work cycle looks like this: Update your working copy Make changes Examine your changes Possibly undo some changes Merge others' changes Commit your changes Update your working copy When working on a project with a team, you'll want to update your working copy to receive any changes made by other developers on the project since your last update. Use the VisualSVN | Update menu item to bring your working copy in sync with the latest revision in the repository.
While updating you'll see TortoiseSVN's Update window that will show you which files of your solution are need to be updated. Make changes 25
Now you can get to work and make changes in your working copy. It's usually most convenient to decide on a discrete change (or set of changes) to make, such as writing a new feature, fixing a bug, etc. You don't need to tell VisualSVN that you intend to make a change. Just make your changes using a text editor or Solution Explorer and VisualSVN automatically detects which changes have been made. Please note that all your changes are local to your own working copy until you commit them to the repository. Examine Your Changes Once you've finished making changes, you need to commit them to the repository, but before you do so, it's usually a good idea to take a look at exactly what you've changed. By examining your changes before you commit, you can write a more accurate log message. You may also discover that you've inadvertently changed a file, and this gives you a chance to revert those changes before committing them. Additionally, this is a good opportunity to review and scrutinize changes before publishing them.
You can see an overview of the changes you've made by using TortoiseSVN's Show Changes window. To open the window choose the VisualSVN | Show Changes command on the main menu. Please note that you can examine your changes without network access. This makes it easy to manage your changes-in-progress even when you are somewhere without a network connection. Possibly undo some changes Suppose while examining your changes you determine that all the changes you made to a particular file are mistakes. Maybe you shouldn't have changed the file at all, or perhaps it would be easier to make different changes starting from scratch. This is a perfect opportunity to use the VisualSVN | Revert main menu command. You'll see TortoiseSVN's Revert window where you can examine and undo some of your changes.
Subversion reverts the file to its pre-modified state by overwriting it with the cached pristine copy from the .svn area. You can also undo any directory modifications. For example, you might decide that you don't want to rename a file after all. Merge other's changes It often happens that while you've been working on your changes, somebody else already finished and committed their own changes to the repository. Thus it's a good idea to merge any changes into your working copy before commiting. Just choose VisualSVN | Update main menu command and all changes committed by others but not reflected in your working copy will be incorporated into your working copy. Let's suppose that you and your collaborator both edited the same file at the same time. Fortunately this is not a problem in most cases and simultaneous changes will be merged by Subversion. However, sometimes Subversion can't automatically merge changes within a file and this file is marked as conflicted. You will be notified about conflicted files in TortoiseSVN's Update window.
For further details about resolving conflicts please consult the chapter called Resolve Conflicts (Merging Other's Changes) in the Version Control with Subversion book. Commit your changes Your edits are finished, you've merged all changes from the server into your working copy, and you're finally ready to commit your changes to the repository. 27
Please choose the VisualSVN | Commit main menu command to send all of your changes to the repository. When you commit a change, you need to supply a log message, describing your change. Your log message will be attached to the new revision you create. The repository doesn't know or care if your changes make any sense as a whole; it only checks to make sure that nobody else has changed any of the files that you changed when you weren't looking. If somebody has done that, the entire commit will fail with a message informing you that one or more of your files are out-of-date:
At this point, you need to update your working copy, deal with any merges or conflicts that result, and attempt your commit again. That covers the basic work cycle for using VisualSVN. There are many other features in VisualSVN that you can use to manage your repository and working copy, but most of your day- to-day use of VisualSVN will involve only the commands that we've discussed so far in this chapter. We will, however, cover a few more commands that you'll use fairly often.
Handy VisualSVN toolbar provides clean, direct access to the most important commands and features of Subversion. We even provide a combo box containing the URL of the current Subversion branch, and you can use it to quickly change between branches. VisualSVN is well recognized as a stable and robust Visual Studio plugin. It is used by Fortune 500 companies, hi-tech startups, Microsoft MVP's and famous open-source projects.